Update dependency prettier to v3 (#12095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
773b03e15e
commit
a0c8575113
110 changed files with 449 additions and 313 deletions
|
@ -29,8 +29,8 @@ export type RecursivePartial<T> = {
|
|||
[P in keyof T]?: T[P] extends (infer U)[]
|
||||
? RecursivePartial<U>[]
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
export type KeysStartingWith<Input extends object, Str extends string> = {
|
||||
|
@ -51,10 +51,10 @@ export type Defaultize<P, D> = P extends any
|
|||
export type DeepReadonly<T> = T extends (infer R)[]
|
||||
? DeepReadonlyArray<R>
|
||||
: T extends Function
|
||||
? T
|
||||
: T extends object
|
||||
? DeepReadonlyObject<T>
|
||||
: T;
|
||||
? T
|
||||
: T extends object
|
||||
? DeepReadonlyObject<T>
|
||||
: T;
|
||||
|
||||
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
|
||||
|
||||
|
|
|
@ -23,7 +23,10 @@ import { PosthogAnalytics } from "./PosthogAnalytics";
|
|||
export class DecryptionFailure {
|
||||
public readonly ts: number;
|
||||
|
||||
public constructor(public readonly failedEventId: string, public readonly errorCode: string) {
|
||||
public constructor(
|
||||
public readonly failedEventId: string,
|
||||
public readonly errorCode: string,
|
||||
) {
|
||||
this.ts = Date.now();
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +113,10 @@ export class DecryptionFailureTracker {
|
|||
* @param {function?} errorCodeMapFn The function used to map error codes to the
|
||||
* trackedErrorCode. If not provided, the `.code` of errors will be used.
|
||||
*/
|
||||
private constructor(private readonly fn: TrackingFn, private readonly errorCodeMapFn: ErrCodeMapFn) {
|
||||
private constructor(
|
||||
private readonly fn: TrackingFn,
|
||||
private readonly errorCodeMapFn: ErrCodeMapFn,
|
||||
) {
|
||||
if (!fn || typeof fn !== "function") {
|
||||
throw new Error("DecryptionFailureTracker requires tracking function");
|
||||
}
|
||||
|
|
|
@ -327,7 +327,10 @@ const topicSanitizeHtmlParams: IExtendedSanitizeOptions = {
|
|||
};
|
||||
|
||||
abstract class BaseHighlighter<T extends React.ReactNode> {
|
||||
public constructor(public highlightClass: string, public highlightLink?: string) {}
|
||||
public constructor(
|
||||
public highlightClass: string,
|
||||
public highlightLink?: string,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Apply the highlights to a section of text
|
||||
|
|
|
@ -34,7 +34,10 @@ export default class ScalarAuthClient {
|
|||
private termsInteractionCallback?: TermsInteractionCallback;
|
||||
private isDefaultManager: boolean;
|
||||
|
||||
public constructor(private apiUrl: string, private uiUrl: string) {
|
||||
public constructor(
|
||||
private apiUrl: string,
|
||||
private uiUrl: string,
|
||||
) {
|
||||
this.scalarToken = null;
|
||||
// `undefined` to allow `startTermsFlow` to fallback to a default
|
||||
// callback if this is unset.
|
||||
|
|
|
@ -33,7 +33,11 @@ export class Service {
|
|||
* @param {string} baseUrl The Base URL of the service (ie. before '/_matrix')
|
||||
* @param {string} accessToken The user's access token for the service
|
||||
*/
|
||||
public constructor(public serviceType: SERVICE_TYPES, public baseUrl: string, public accessToken: string) {}
|
||||
public constructor(
|
||||
public serviceType: SERVICE_TYPES,
|
||||
public baseUrl: string,
|
||||
public accessToken: string,
|
||||
) {}
|
||||
}
|
||||
|
||||
export interface LocalisedPolicy {
|
||||
|
|
|
@ -45,7 +45,10 @@ export default class UserActivity {
|
|||
private lastScreenX = 0;
|
||||
private lastScreenY = 0;
|
||||
|
||||
public constructor(private readonly window: Window, private readonly document: Document) {
|
||||
public constructor(
|
||||
private readonly window: Window,
|
||||
private readonly document: Document,
|
||||
) {
|
||||
this.activeNowTimeout = new Timer(CURRENTLY_ACTIVE_THRESHOLD_MS);
|
||||
this.activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,11 @@ import { DEFAULT_WAVEFORM } from "./consts";
|
|||
* A managed playback is a Playback instance that is guided by a PlaybackManager.
|
||||
*/
|
||||
export class ManagedPlayback extends Playback {
|
||||
public constructor(private manager: PlaybackManager, buf: ArrayBuffer, seedWaveform = DEFAULT_WAVEFORM) {
|
||||
public constructor(
|
||||
private manager: PlaybackManager,
|
||||
buf: ArrayBuffer,
|
||||
seedWaveform = DEFAULT_WAVEFORM,
|
||||
) {
|
||||
super(buf, seedWaveform);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,10 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
|
|||
* @param {number[]} seedWaveform Optional seed waveform to present until the proper waveform
|
||||
* can be calculated. Contains values between zero and one, inclusive.
|
||||
*/
|
||||
public constructor(private buf: ArrayBuffer, seedWaveform = DEFAULT_WAVEFORM) {
|
||||
public constructor(
|
||||
private buf: ArrayBuffer,
|
||||
seedWaveform = DEFAULT_WAVEFORM,
|
||||
) {
|
||||
super();
|
||||
// Capture the file size early as reading the buffer will result in a 0-length buffer left behind
|
||||
this.fileSize = this.buf.byteLength;
|
||||
|
|
|
@ -37,7 +37,10 @@ export class VoiceMessageRecording implements IDestroyable {
|
|||
private buffer = new Uint8Array(0); // use this.audioBuffer to access
|
||||
private playback?: Playback;
|
||||
|
||||
public constructor(private matrixClient: MatrixClient, private voiceRecording: VoiceRecording) {
|
||||
public constructor(
|
||||
private matrixClient: MatrixClient,
|
||||
private voiceRecording: VoiceRecording,
|
||||
) {
|
||||
this.voiceRecording.onDataAvailable = this.onDataAvailable;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,10 @@ import { TimelineRenderingType } from "../contexts/RoomContext";
|
|||
const AT_ROOM_REGEX = /@\S*/g;
|
||||
|
||||
export default class NotifProvider extends AutocompleteProvider {
|
||||
public constructor(public room: Room, renderingType?: TimelineRenderingType) {
|
||||
public constructor(
|
||||
public room: Room,
|
||||
renderingType?: TimelineRenderingType,
|
||||
) {
|
||||
super({ commandRegex: AT_ROOM_REGEX, renderingType });
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,10 @@ function matcherObject(
|
|||
export default class RoomProvider extends AutocompleteProvider {
|
||||
protected matcher: QueryMatcher<ReturnType<typeof matcherObject>>;
|
||||
|
||||
public constructor(private readonly room: Room, renderingType?: TimelineRenderingType) {
|
||||
public constructor(
|
||||
private readonly room: Room,
|
||||
renderingType?: TimelineRenderingType,
|
||||
) {
|
||||
super({ commandRegex: ROOM_REGEX, renderingType });
|
||||
this.matcher = new QueryMatcher<ReturnType<typeof matcherObject>>([], {
|
||||
keys: ["displayedAlias", "matchName"],
|
||||
|
|
|
@ -204,7 +204,8 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
|
|||
|
||||
useEffect(() => {
|
||||
const room = mxClient.getRoom(roomId);
|
||||
room?.createThreadsTimelineSets()
|
||||
room
|
||||
?.createThreadsTimelineSets()
|
||||
.then(() => room.fetchRoomThreads())
|
||||
.then(() => {
|
||||
setFilterOption(ThreadFilterType.All);
|
||||
|
|
|
@ -362,32 +362,31 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
|
|||
|
||||
const defaultRendererFactory =
|
||||
(title: TranslationKey): Renderer =>
|
||||
(rooms, selectedToAdd, { scrollTop, height }, onChange) =>
|
||||
(
|
||||
<div className="mx_AddExistingToSpace_section">
|
||||
<h3>{_t(title)}</h3>
|
||||
<LazyRenderList
|
||||
itemHeight={ROW_HEIGHT}
|
||||
items={rooms}
|
||||
scrollTop={scrollTop}
|
||||
height={height}
|
||||
renderItem={(room) => (
|
||||
<Entry
|
||||
key={room.roomId}
|
||||
room={room}
|
||||
checked={selectedToAdd.has(room)}
|
||||
onChange={
|
||||
onChange
|
||||
? (checked: boolean) => {
|
||||
onChange(checked, room);
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
(rooms, selectedToAdd, { scrollTop, height }, onChange) => (
|
||||
<div className="mx_AddExistingToSpace_section">
|
||||
<h3>{_t(title)}</h3>
|
||||
<LazyRenderList
|
||||
itemHeight={ROW_HEIGHT}
|
||||
items={rooms}
|
||||
scrollTop={scrollTop}
|
||||
height={height}
|
||||
renderItem={(room) => (
|
||||
<Entry
|
||||
key={room.roomId}
|
||||
room={room}
|
||||
checked={selectedToAdd.has(room)}
|
||||
onChange={
|
||||
onChange
|
||||
? (checked: boolean) => {
|
||||
onChange(checked, room);
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const defaultRoomsRenderer = defaultRendererFactory(_td("common|rooms"));
|
||||
export const defaultSpacesRenderer = defaultRendererFactory(_td("common|spaces"));
|
||||
|
|
|
@ -252,12 +252,15 @@ const findVisibleRoomMembers = (visibleRooms: Room[], cli: MatrixClient, filterD
|
|||
return Object.values(
|
||||
visibleRooms
|
||||
.filter((room) => !filterDMs || !DMRoomMap.shared().getUserIdForRoomId(room.roomId))
|
||||
.reduce((members, room) => {
|
||||
for (const member of room.getJoinedMembers()) {
|
||||
members[member.userId] = member;
|
||||
}
|
||||
return members;
|
||||
}, {} as Record<string, RoomMember>),
|
||||
.reduce(
|
||||
(members, room) => {
|
||||
for (const member of room.getJoinedMembers()) {
|
||||
members[member.userId] = member;
|
||||
}
|
||||
return members;
|
||||
},
|
||||
{} as Record<string, RoomMember>,
|
||||
),
|
||||
).filter((it) => it.userId !== cli.getUserId());
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,11 @@ limitations under the License.
|
|||
import React from "react";
|
||||
|
||||
class ItemRange {
|
||||
public constructor(public topCount: number, public renderCount: number, public bottomCount: number) {}
|
||||
public constructor(
|
||||
public topCount: number,
|
||||
public renderCount: number,
|
||||
public bottomCount: number,
|
||||
) {}
|
||||
|
||||
public contains(range: ItemRange): boolean {
|
||||
// don't contain empty ranges
|
||||
|
|
|
@ -61,7 +61,8 @@ export default class SpellCheckLanguagesDropdown extends React.Component<
|
|||
const plaf = PlatformPeg.get();
|
||||
if (plaf) {
|
||||
const languageNames = new Intl.DisplayNames([getUserLanguage()], { type: "language", style: "short" });
|
||||
plaf.getAvailableSpellCheckLanguages()
|
||||
plaf
|
||||
.getAvailableSpellCheckLanguages()
|
||||
?.then((languages) => {
|
||||
languages.sort(function (a, b) {
|
||||
if (a < b) return -1;
|
||||
|
|
|
@ -366,7 +366,11 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
|||
}
|
||||
}
|
||||
export class UserVote {
|
||||
public constructor(public readonly ts: number, public readonly sender: string, public readonly answers: string[]) {}
|
||||
public constructor(
|
||||
public readonly ts: number,
|
||||
public readonly sender: string,
|
||||
public readonly answers: string[],
|
||||
) {}
|
||||
}
|
||||
|
||||
function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote {
|
||||
|
|
|
@ -650,8 +650,8 @@ export const RoomKickButton = ({
|
|||
? _t("user_info|disinvite_button_space")
|
||||
: _t("user_info|kick_button_space")
|
||||
: member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room"),
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room"),
|
||||
title:
|
||||
member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room_name", { roomName: room.name })
|
||||
|
@ -721,8 +721,8 @@ export const RoomKickButton = ({
|
|||
? _t("user_info|disinvite_button_space")
|
||||
: _t("user_info|kick_button_space")
|
||||
: member.membership === "invite"
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room");
|
||||
? _t("user_info|disinvite_button_room")
|
||||
: _t("user_info|kick_button_room");
|
||||
|
||||
return (
|
||||
<AccessibleButton
|
||||
|
@ -782,8 +782,8 @@ export const BanToggleButton = ({
|
|||
? _t("user_info|unban_button_space")
|
||||
: _t("user_info|ban_button_space")
|
||||
: isBanned
|
||||
? _t("user_info|unban_button_room")
|
||||
: _t("user_info|ban_button_room"),
|
||||
? _t("user_info|unban_button_room")
|
||||
: _t("user_info|ban_button_room"),
|
||||
title: isBanned
|
||||
? _t("user_info|unban_room_confirm_title", { roomName: room.name })
|
||||
: _t("user_info|ban_room_confirm_title", { roomName: room.name }),
|
||||
|
|
|
@ -101,9 +101,8 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||
const masterPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.masterKey;
|
||||
const selfSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.selfSigningKey;
|
||||
const userSigningPrivateKeyCached = crossSigningStatus.privateKeysCachedLocally.userSigningKey;
|
||||
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature(
|
||||
"org.matrix.e2e_cross_signing",
|
||||
);
|
||||
const homeserverSupportsCrossSigning =
|
||||
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing");
|
||||
const crossSigningReady = await crypto.isCrossSigningReady();
|
||||
|
||||
this.setState({
|
||||
|
|
|
@ -194,13 +194,14 @@ const SessionManagerTab: React.FC = () => {
|
|||
setFilter(filter);
|
||||
clearTimeout(scrollIntoViewTimeoutRef.current);
|
||||
// wait a tick for the filtered section to rerender with different height
|
||||
scrollIntoViewTimeoutRef.current = window.setTimeout(() =>
|
||||
filteredDeviceListRef.current?.scrollIntoView({
|
||||
// align element to top of scrollbox
|
||||
block: "start",
|
||||
inline: "nearest",
|
||||
behavior: "smooth",
|
||||
}),
|
||||
scrollIntoViewTimeoutRef.current = window.setTimeout(
|
||||
() =>
|
||||
filteredDeviceListRef.current?.scrollIntoView({
|
||||
// align element to top of scrollbox
|
||||
block: "start",
|
||||
inline: "nearest",
|
||||
behavior: "smooth",
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -36,7 +36,10 @@ export class Media {
|
|||
private client: MatrixClient;
|
||||
|
||||
// Per above, this constructor signature can be whatever is helpful for you.
|
||||
public constructor(private prepared: IPreparedMedia, client?: MatrixClient) {
|
||||
public constructor(
|
||||
private prepared: IPreparedMedia,
|
||||
client?: MatrixClient,
|
||||
) {
|
||||
this.client = client ?? MatrixClientPeg.safeGet();
|
||||
if (!this.client) {
|
||||
throw new Error("No possible MatrixClient for media resolution. Please provide one or log in.");
|
||||
|
|
|
@ -57,7 +57,11 @@ export default class EditorModel {
|
|||
private autoCompletePartCount = 0;
|
||||
private transformCallback: TransformCallback | null = null;
|
||||
|
||||
public constructor(parts: Part[], partCreator: PartCreator, private updateCallback: UpdateCallback | null = null) {
|
||||
public constructor(
|
||||
parts: Part[],
|
||||
partCreator: PartCreator,
|
||||
private updateCallback: UpdateCallback | null = null,
|
||||
) {
|
||||
this._parts = parts;
|
||||
this._partCreator = partCreator;
|
||||
this.transformCallback = null;
|
||||
|
|
|
@ -18,7 +18,10 @@ import EditorModel from "./model";
|
|||
import DocumentPosition from "./position";
|
||||
|
||||
export default class DocumentOffset {
|
||||
public constructor(public offset: number, public readonly atNodeEnd: boolean) {}
|
||||
public constructor(
|
||||
public offset: number,
|
||||
public readonly atNodeEnd: boolean,
|
||||
) {}
|
||||
|
||||
public asPosition(model: EditorModel): DocumentPosition {
|
||||
return model.positionForOffset(this.offset, this.atNodeEnd);
|
||||
|
|
|
@ -254,7 +254,10 @@ export class PlainPart extends PlainBasePart implements IBasePart {
|
|||
}
|
||||
|
||||
export abstract class PillPart extends BasePart implements IPillPart {
|
||||
public constructor(public resourceId: string, label: string) {
|
||||
public constructor(
|
||||
public resourceId: string,
|
||||
label: string,
|
||||
) {
|
||||
super(label);
|
||||
}
|
||||
|
||||
|
@ -414,7 +417,11 @@ export class EmojiPart extends BasePart implements IBasePart {
|
|||
}
|
||||
|
||||
class RoomPillPart extends PillPart {
|
||||
public constructor(resourceId: string, label: string, private room?: Room) {
|
||||
public constructor(
|
||||
resourceId: string,
|
||||
label: string,
|
||||
private room?: Room,
|
||||
) {
|
||||
super(resourceId, label);
|
||||
}
|
||||
|
||||
|
@ -455,7 +462,11 @@ class AtRoomPillPart extends RoomPillPart {
|
|||
}
|
||||
|
||||
class UserPillPart extends PillPart {
|
||||
public constructor(userId: string, displayName: string, private member?: RoomMember) {
|
||||
public constructor(
|
||||
userId: string,
|
||||
displayName: string,
|
||||
private member?: RoomMember,
|
||||
) {
|
||||
super(userId, displayName);
|
||||
}
|
||||
|
||||
|
@ -490,7 +501,10 @@ class UserPillPart extends PillPart {
|
|||
}
|
||||
|
||||
class PillCandidatePart extends PlainBasePart implements IPillCandidatePart {
|
||||
public constructor(text: string, private autoCompleteCreator: IAutocompleteCreator) {
|
||||
public constructor(
|
||||
text: string,
|
||||
private autoCompleteCreator: IAutocompleteCreator,
|
||||
) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ type Callback = (part: Part, startIdx: number, endIdx: number) => void;
|
|||
export type Predicate = (index: number, offset: number, part: Part) => boolean;
|
||||
|
||||
export default class DocumentPosition implements IPosition {
|
||||
public constructor(public readonly index: number, public readonly offset: number) {}
|
||||
public constructor(
|
||||
public readonly index: number,
|
||||
public readonly offset: number,
|
||||
) {}
|
||||
|
||||
public compare(otherPos: DocumentPosition): number {
|
||||
if (this.index === otherPos.index) {
|
||||
|
|
|
@ -28,7 +28,11 @@ export default class Range {
|
|||
private _lastStart: DocumentPosition;
|
||||
private _initializedEmpty: boolean;
|
||||
|
||||
public constructor(public readonly model: EditorModel, positionA: DocumentPosition, positionB = positionA) {
|
||||
public constructor(
|
||||
public readonly model: EditorModel,
|
||||
positionA: DocumentPosition,
|
||||
positionB = positionA,
|
||||
) {
|
||||
const bIsLarger = positionA.compare(positionB) < 0;
|
||||
this._start = bIsLarger ? positionA : positionB;
|
||||
this._end = bIsLarger ? positionB : positionA;
|
||||
|
|
|
@ -570,10 +570,13 @@ export class JitsiCall extends Call {
|
|||
// Tell others that we're connected, by adding our device to room state
|
||||
await this.addOurDevice();
|
||||
// Re-add this device every so often so our video member event doesn't become stale
|
||||
this.resendDevicesTimer = window.setInterval(async (): Promise<void> => {
|
||||
logger.log(`Resending video member event for ${this.roomId}`);
|
||||
await this.addOurDevice();
|
||||
}, (this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4);
|
||||
this.resendDevicesTimer = window.setInterval(
|
||||
async (): Promise<void> => {
|
||||
logger.log(`Resending video member event for ${this.roomId}`);
|
||||
await this.addOurDevice();
|
||||
},
|
||||
(this.STUCK_DEVICE_TIMEOUT_MS * 3) / 4,
|
||||
);
|
||||
} else if (state === ConnectionState.Disconnected && isConnected(prevState)) {
|
||||
this.updateParticipants(); // Local echo
|
||||
|
||||
|
@ -717,7 +720,11 @@ export class ElementCall extends Call {
|
|||
this.widget.url = ElementCall.generateWidgetUrl(this.client, this.roomId).toString();
|
||||
}
|
||||
|
||||
private constructor(public session: MatrixRTCSession, widget: IApp, client: MatrixClient) {
|
||||
private constructor(
|
||||
public session: MatrixRTCSession,
|
||||
widget: IApp,
|
||||
client: MatrixClient,
|
||||
) {
|
||||
super(widget, client);
|
||||
|
||||
this.session.on(MatrixRTCSessionEvent.MembershipsChanged, this.onMembershipChanged);
|
||||
|
|
|
@ -138,7 +138,10 @@ export class IndexedDBLogStore {
|
|||
private flushPromise: Promise<void> | null = null;
|
||||
private flushAgainPromise: Promise<void> | null = null;
|
||||
|
||||
public constructor(private indexedDB: IDBFactory, private logger: ConsoleLogger) {
|
||||
public constructor(
|
||||
private indexedDB: IDBFactory,
|
||||
private logger: ConsoleLogger,
|
||||
) {
|
||||
this.id = "instance-" + randomString(16);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,10 @@ import SettingController from "./SettingController";
|
|||
* When the value changes, call a setter function on the matrix client with the new value
|
||||
*/
|
||||
export default class PushToMatrixClientController extends SettingController {
|
||||
public constructor(private setter: Function, private inverse: boolean) {
|
||||
public constructor(
|
||||
private setter: Function,
|
||||
private inverse: boolean,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,10 @@ import SettingsStore from "../SettingsStore";
|
|||
* Settings using this controller are assumed to return `false` when disabled.
|
||||
*/
|
||||
export default class UIFeatureController extends SettingController {
|
||||
public constructor(private uiFeatureName: string, private forcedValue = false) {
|
||||
public constructor(
|
||||
private uiFeatureName: string,
|
||||
private forcedValue = false,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ export default class DefaultSettingsHandler extends SettingsHandler {
|
|||
* @param {object} defaults The default setting values, keyed by setting name.
|
||||
* @param {object} invertedDefaults The default inverted setting values, keyed by setting name.
|
||||
*/
|
||||
public constructor(private defaults: Record<string, any>, private invertedDefaults: Record<string, any>) {
|
||||
public constructor(
|
||||
private defaults: Record<string, any>,
|
||||
private invertedDefaults: Record<string, any>,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,10 @@ export default class DeviceSettingsHandler extends AbstractLocalStorageSettingsH
|
|||
* @param {string[]} featureNames The names of known features.
|
||||
* @param {WatchManager} watchers The watch manager to notify updates to
|
||||
*/
|
||||
public constructor(private featureNames: string[], public readonly watchers: WatchManager) {
|
||||
public constructor(
|
||||
private featureNames: string[],
|
||||
public readonly watchers: WatchManager,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,10 @@ export default class LocalEchoWrapper extends SettingsHandler {
|
|||
* @param {SettingsHandler} handler The handler to wrap
|
||||
* @param {SettingLevel} level The level to notify updates at
|
||||
*/
|
||||
public constructor(private readonly handler: SettingsHandler, private readonly level: SettingLevel) {
|
||||
public constructor(
|
||||
private readonly handler: SettingsHandler,
|
||||
private readonly level: SettingLevel,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,10 @@ export abstract class AsyncStore<T extends Object> extends EventEmitter {
|
|||
* @param {Dispatcher<ActionPayload>} dispatcher The dispatcher to rely upon.
|
||||
* @param {T} initialState The initial state for the store.
|
||||
*/
|
||||
protected constructor(private dispatcher: MatrixDispatcher, initialState: T = <T>{}) {
|
||||
protected constructor(
|
||||
private dispatcher: MatrixDispatcher,
|
||||
initialState: T = <T>{},
|
||||
) {
|
||||
super();
|
||||
|
||||
this.dispatcherRef = dispatcher.register(this.onDispatch.bind(this));
|
||||
|
|
|
@ -160,7 +160,10 @@ export class RoomViewStore extends EventEmitter {
|
|||
private dis?: MatrixDispatcher;
|
||||
private dispatchToken?: string;
|
||||
|
||||
public constructor(dis: MatrixDispatcher, private readonly stores: SdkContextClass) {
|
||||
public constructor(
|
||||
dis: MatrixDispatcher,
|
||||
private readonly stores: SdkContextClass,
|
||||
) {
|
||||
super();
|
||||
this.resetDispatcher(dis);
|
||||
this.stores.voiceBroadcastRecordingsStore.addListener(
|
||||
|
@ -319,14 +322,14 @@ export class RoomViewStore extends EventEmitter {
|
|||
numMembers > 1000
|
||||
? "MoreThanAThousand"
|
||||
: numMembers > 100
|
||||
? "OneHundredAndOneToAThousand"
|
||||
: numMembers > 10
|
||||
? "ElevenToOneHundred"
|
||||
: numMembers > 2
|
||||
? "ThreeToTen"
|
||||
: numMembers > 1
|
||||
? "Two"
|
||||
: "One";
|
||||
? "OneHundredAndOneToAThousand"
|
||||
: numMembers > 10
|
||||
? "ElevenToOneHundred"
|
||||
: numMembers > 2
|
||||
? "ThreeToTen"
|
||||
: numMembers > 1
|
||||
? "Two"
|
||||
: "One";
|
||||
|
||||
this.stores.posthogAnalytics.trackEvent<JoinedRoomEvent>({
|
||||
eventName: "JoinedRoom",
|
||||
|
|
|
@ -30,7 +30,10 @@ export class EchoTransaction extends Whenable<TransactionStatus> {
|
|||
|
||||
public readonly startTime = new Date();
|
||||
|
||||
public constructor(public readonly auditName: string, public runFn: RunFn) {
|
||||
public constructor(
|
||||
public readonly auditName: string,
|
||||
public runFn: RunFn,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,10 @@ export abstract class GenericEchoChamber<C extends EchoContext, K, V> extends Ev
|
|||
private cache = new Map<K, { txn: EchoTransaction; val: V }>();
|
||||
protected matrixClient: MatrixClient | null = null;
|
||||
|
||||
protected constructor(public readonly context: C, private lookupFn: (key: K) => V) {
|
||||
protected constructor(
|
||||
public readonly context: C,
|
||||
private lookupFn: (key: K) => V,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ export class ListNotificationState extends NotificationState {
|
|||
private rooms: Room[] = [];
|
||||
private states: { [roomId: string]: RoomNotificationState } = {};
|
||||
|
||||
public constructor(private byTileCount = false, private getRoomFn: FetchRoomFn) {
|
||||
public constructor(
|
||||
private byTileCount = false,
|
||||
private getRoomFn: FetchRoomFn,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,10 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
|
|||
private counts: Record<TagID, number> = {};
|
||||
private stickyRoomId: Optional<string>;
|
||||
|
||||
public constructor(dis: MatrixDispatcher, private readonly context: SdkContextClass) {
|
||||
public constructor(
|
||||
dis: MatrixDispatcher,
|
||||
private readonly context: SdkContextClass,
|
||||
) {
|
||||
super(dis);
|
||||
this.setMaxListeners(20); // RoomList + LeftPanel + 8xRoomSubList + spares
|
||||
}
|
||||
|
|
|
@ -30,7 +30,10 @@ export abstract class OrderingAlgorithm {
|
|||
// set by setSortAlgorithm() in ctor
|
||||
protected sortingAlgorithm!: SortAlgorithm;
|
||||
|
||||
protected constructor(protected tagId: TagID, initialSortingAlgorithm: SortAlgorithm) {
|
||||
protected constructor(
|
||||
protected tagId: TagID,
|
||||
initialSortingAlgorithm: SortAlgorithm,
|
||||
) {
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
this.setSortAlgorithm(initialSortingAlgorithm); // we use the setter for validation
|
||||
}
|
||||
|
|
|
@ -202,15 +202,18 @@ export default class DMRoomMap {
|
|||
public getUniqueRoomsWithIndividuals(): { [userId: string]: Room } {
|
||||
if (!this.roomToUser) return {}; // No rooms means no map.
|
||||
// map roomToUser to valid rooms with two participants
|
||||
return Object.keys(this.roomToUser).reduce((acc, roomId: string) => {
|
||||
const userId = this.getUserIdForRoomId(roomId);
|
||||
const room = this.matrixClient.getRoom(roomId);
|
||||
const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2;
|
||||
if (userId && room && hasTwoMembers) {
|
||||
acc[userId] = room;
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, Room>);
|
||||
return Object.keys(this.roomToUser).reduce(
|
||||
(acc, roomId: string) => {
|
||||
const userId = this.getUserIdForRoomId(roomId);
|
||||
const room = this.matrixClient.getRoom(roomId);
|
||||
const hasTwoMembers = room?.getInvitedAndJoinedMemberCount() === 2;
|
||||
if (userId && room && hasTwoMembers) {
|
||||
acc[userId] = room;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, Room>,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,10 @@ export class FixedRollingArray<T> {
|
|||
* @param width The width of the array.
|
||||
* @param padValue The value to seed the array with.
|
||||
*/
|
||||
public constructor(private width: number, padValue: T) {
|
||||
public constructor(
|
||||
private width: number,
|
||||
padValue: T,
|
||||
) {
|
||||
this.samples = arraySeed(padValue, this.width);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,10 @@ export class MarkedExecution {
|
|||
* @param {Function} onMarkCallback A function that is called when a new mark is made. Not
|
||||
* called if a mark is already flagged.
|
||||
*/
|
||||
public constructor(private fn: () => void, private onMarkCallback?: () => void) {}
|
||||
public constructor(
|
||||
private fn: () => void,
|
||||
private onMarkCallback?: () => void,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Resets the mark without calling the function.
|
||||
|
|
|
@ -76,8 +76,8 @@ export async function upgradeRoom(
|
|||
if (updateSpaces) {
|
||||
parentsToRelink = Array.from(SpaceStore.instance.getKnownParents(room.roomId))
|
||||
.map((roomId) => cli.getRoom(roomId))
|
||||
.filter((parent) =>
|
||||
parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!),
|
||||
.filter(
|
||||
(parent) => parent?.currentState.maySendStateEvent(EventType.SpaceChild, cli.getUserId()!),
|
||||
) as Room[];
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,10 @@ export class Singleflight {
|
|||
}
|
||||
|
||||
class SingleflightContext {
|
||||
public constructor(private instance: Object, private key: string) {}
|
||||
public constructor(
|
||||
private instance: Object,
|
||||
private key: string,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Forget this particular instance and key combination, discarding the result.
|
||||
|
|
|
@ -32,8 +32,19 @@ limitations under the License.
|
|||
bottom: 30px;
|
||||
font-size: 17px;
|
||||
padding: 6px 16px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu,
|
||||
roboto, noto, arial, sans-serif;
|
||||
font-family:
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
avenir next,
|
||||
avenir,
|
||||
segoe ui,
|
||||
helvetica neue,
|
||||
helvetica,
|
||||
Ubuntu,
|
||||
roboto,
|
||||
noto,
|
||||
arial,
|
||||
sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1.43;
|
||||
border-radius: 4px;
|
||||
|
@ -42,8 +53,12 @@ limitations under the License.
|
|||
|
||||
#snackbar.mx_show {
|
||||
visibility: visible;
|
||||
-webkit-animation: mx_snackbar_fadein 0.5s, mx_snackbar_fadeout 0.5s 2.5s;
|
||||
animation: mx_snackbar_fadein 0.5s, mx_snackbar_fadeout 0.5s 2.5s;
|
||||
-webkit-animation:
|
||||
mx_snackbar_fadein 0.5s,
|
||||
mx_snackbar_fadeout 0.5s 2.5s;
|
||||
animation:
|
||||
mx_snackbar_fadein 0.5s,
|
||||
mx_snackbar_fadeout 0.5s 2.5s;
|
||||
}
|
||||
|
||||
a.mx_reply_anchor {
|
||||
|
|
|
@ -93,7 +93,11 @@ export class RoomPermalinkCreator {
|
|||
// Some of the tests done by this class are relatively expensive, so normally
|
||||
// throttled to not happen on every update. Pass false as the shouldThrottle
|
||||
// param to disable this behaviour, eg. for tests.
|
||||
public constructor(private room: Room | null, roomId: string | null = null, shouldThrottle = true) {
|
||||
public constructor(
|
||||
private room: Room | null,
|
||||
roomId: string | null = null,
|
||||
shouldThrottle = true,
|
||||
) {
|
||||
this.roomId = room ? room.roomId : roomId!;
|
||||
|
||||
if (!this.roomId) {
|
||||
|
|
|
@ -63,7 +63,10 @@ export class VoiceBroadcastRecorder
|
|||
// current chunk length in seconds
|
||||
private currentChunkLength = 0;
|
||||
|
||||
public constructor(private voiceRecording: VoiceRecording, public readonly targetChunkLength: number) {
|
||||
public constructor(
|
||||
private voiceRecording: VoiceRecording,
|
||||
public readonly targetChunkLength: number,
|
||||
) {
|
||||
super();
|
||||
this.voiceRecording.onDataAvailable = this.onDataAvailable;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,10 @@ export class WidgetType {
|
|||
public static readonly CUSTOM = new WidgetType("m.custom", "m.custom");
|
||||
public static readonly CALL = new WidgetType("m.call", "m.call");
|
||||
|
||||
public constructor(public readonly preferred: string, public readonly legacy: string) {}
|
||||
public constructor(
|
||||
public readonly preferred: string,
|
||||
public readonly legacy: string,
|
||||
) {}
|
||||
|
||||
public matches(type: string): boolean {
|
||||
return type === this.preferred || type === this.legacy;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue