Add missing semicolons

This commit is contained in:
Danila Fedorin 2021-08-13 15:28:34 -07:00
parent c8f4cb5046
commit 31b02f1eff
23 changed files with 157 additions and 157 deletions

View File

@ -21,16 +21,16 @@ type Reducer<A,B> = (acc: B, val: A) => B
type IDBQuery = IDBValidKey | IDBKeyRange
interface QueryTargetInterface<T> {
openCursor: (range?: IDBQuery | null , direction?: IDBCursorDirection) => IDBRequest<IDBCursorWithValue | null>
openKeyCursor: (range?: IDBQuery, direction?: IDBCursorDirection) => IDBRequest<IDBCursor | null>
supports: (method: string) => boolean
keyPath: string | string[]
get: (key: IDBQuery) => IDBRequest<T | null>
getKey: (key: IDBQuery) => IDBRequest<IDBValidKey | undefined>
openCursor: (range?: IDBQuery | null , direction?: IDBCursorDirection) => IDBRequest<IDBCursorWithValue | null>;
openKeyCursor: (range?: IDBQuery, direction?: IDBCursorDirection) => IDBRequest<IDBCursor | null>;
supports: (method: string) => boolean;
keyPath: string | string[];
get: (key: IDBQuery) => IDBRequest<T | null>;
getKey: (key: IDBQuery) => IDBRequest<IDBValidKey | undefined>;
}
export class QueryTarget<T> {
protected _target: QueryTargetInterface<T>
protected _target: QueryTargetInterface<T>;
constructor(target: QueryTargetInterface<T>) {
this._target = target;

View File

@ -21,9 +21,9 @@ import { reqAsPromise } from "./utils";
const WEBKITEARLYCLOSETXNBUG_BOGUS_KEY = "782rh281re38-boguskey";
export class Storage {
private _db: IDBDatabase
private _hasWebkitEarlyCloseTxnBug: boolean
storeNames: { [ name : string] : string }
private _db: IDBDatabase;
private _hasWebkitEarlyCloseTxnBug: boolean;
storeNames: { [ name : string] : string };
constructor(idbDatabase: IDBDatabase, IDBKeyRange, hasWebkitEarlyCloseTxnBug: boolean) {
this._db = idbDatabase;

View File

@ -26,7 +26,7 @@ const openDatabaseWithSessionId = function(sessionId: string, idbFactory: IDBFac
}
interface ServiceWorkerHandler {
preventConcurrentSessionAccess: (sessionId: string) => Promise<void>
preventConcurrentSessionAccess: (sessionId: string) => Promise<void>;
}
async function requestPersistedStorage(): Promise<boolean> {
@ -47,8 +47,8 @@ async function requestPersistedStorage(): Promise<boolean> {
}
export class StorageFactory {
private _serviceWorkerHandler: ServiceWorkerHandler
private _idbFactory: IDBFactory
private _serviceWorkerHandler: ServiceWorkerHandler;
private _idbFactory: IDBFactory;
constructor(serviceWorkerHandler: ServiceWorkerHandler, idbFactory: IDBFactory = window.indexedDB, IDBKeyRange = window.IDBKeyRange) {
this._serviceWorkerHandler = serviceWorkerHandler;

View File

@ -16,8 +16,8 @@ limitations under the License.
import {QueryTarget} from "./QueryTarget";
import {IDBRequestAttemptError} from "./error";
import {reqAsPromise} from "./utils"
import {Transaction} from "./Transaction"
import {reqAsPromise} from "./utils";
import {Transaction} from "./Transaction";
const LOG_REQUESTS = false;
@ -28,7 +28,7 @@ function logRequest(method: string, params: any[], source: any) {
}
class QueryTargetWrapper<T> {
private _qt: IDBIndex | IDBObjectStore
private _qt: IDBIndex | IDBObjectStore;
constructor(qt: IDBIndex | IDBObjectStore) {
this._qt = qt;
@ -129,7 +129,7 @@ class QueryTargetWrapper<T> {
}
export class Store<T> extends QueryTarget<T> {
private _transaction: Transaction
private _transaction: Transaction;
constructor(idbStore: IDBObjectStore, transaction: Transaction) {
super(new QueryTargetWrapper<T>(idbStore));

View File

@ -36,9 +36,9 @@ import {OperationStore} from "./stores/OperationStore";
import {AccountDataStore} from "./stores/AccountDataStore";
export class Transaction {
private _txn: IDBTransaction
private _allowedStoreNames: string[]
private _stores: { [storeName : string] : any }
private _txn: IDBTransaction;
private _allowedStoreNames: string[];
private _stores: { [storeName : string] : any };
constructor(txn: IDBTransaction, allowedStoreNames: string[], IDBKeyRange) {
this._txn = txn;

View File

@ -13,16 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {Store} from "../Store";
import {Content} from "../../types";
interface AccountDataEntry {
type: string
content: Content
type: string;
content: Content;
}
export class AccountDataStore {
private _store: Store<AccountDataEntry>
private _store: Store<AccountDataEntry>;
constructor(store: Store<AccountDataEntry>) {
this._store = store;

View File

@ -15,16 +15,16 @@ limitations under the License.
*/
import {MAX_UNICODE, MIN_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
interface DeviceIdentity {
userId: string
deviceId: string
ed25519Key: string
curve25519Key: string
algorithms: string[]
displayName: string
key: string
userId: string;
deviceId: string;
ed25519Key: string;
curve25519Key: string;
algorithms: string[];
displayName: string;
key: string;
}
function encodeKey(userId: string, deviceId: string): string {
@ -37,7 +37,7 @@ function decodeKey(key: string): { userId: string, deviceId: string } {
}
export class DeviceIdentityStore {
private _store: Store<DeviceIdentity>
private _store: Store<DeviceIdentity>;
constructor(store: Store<DeviceIdentity>) {
this._store = store;

View File

@ -15,20 +15,20 @@ limitations under the License.
*/
import {MIN_UNICODE, MAX_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
function encodeKey(roomId: string, sessionId: string, messageIndex: number | string): string {
return `${roomId}|${sessionId}|${messageIndex}`;
}
interface GroupSessionDecryption {
eventId: string
timestamp: number
key: string
eventId: string;
timestamp: number;
key: string;
}
export class GroupSessionDecryptionStore {
private _store: Store<GroupSessionDecryption>
private _store: Store<GroupSessionDecryption>;
constructor(store: Store<GroupSessionDecryption>) {
this._store = store;

View File

@ -15,16 +15,16 @@ limitations under the License.
*/
import {MIN_UNICODE, MAX_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
interface InboundGroupSession {
roomId: string
senderKey: string
sessionId: string
session?: string
claimedKeys?: { [algorithm : string] : string }
eventIds?: string[]
key: string
roomId: string;
senderKey: string;
sessionId: string;
session?: string;
claimedKeys?: { [algorithm : string] : string };
eventIds?: string[];
key: string;
}
function encodeKey(roomId: string, senderKey: string, sessionId: string) {
@ -32,7 +32,7 @@ function encodeKey(roomId: string, senderKey: string, sessionId: string) {
}
export class InboundGroupSessionStore {
private _store: Store<InboundGroupSession>
private _store: Store<InboundGroupSession>;
constructor(store: Store<InboundGroupSession>) {
this._store = store;

View File

@ -13,25 +13,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {MemberData} from "./RoomMemberStore"
import {Store} from "../Store";
import {MemberData} from "./RoomMemberStore";
// TODO: Move to Invite when that's TypeScript.
export interface InviteData {
roomId: string
isEncrypted: boolean
isDirectMessage: boolean
name?: string
avatarUrl?: string
avatarColorId: number
canonicalAlias?: string
timestamp: number
joinRule: string
inviter?: MemberData
roomId: string;
isEncrypted: boolean;
isDirectMessage: boolean;
name?: string;
avatarUrl?: string;
avatarColorId: number;
canonicalAlias?: string;
timestamp: number;
joinRule: string;
inviter?: MemberData;
}
export class InviteStore {
private _inviteStore: Store<InviteData>
private _inviteStore: Store<InviteData>;
constructor(inviteStore: Store<InviteData>) {
this._inviteStore = inviteStore;

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {Store} from "../Store";
function encodeKey(senderKey: string, sessionId: string): string {
return `${senderKey}|${sessionId}`;
@ -25,15 +25,15 @@ function decodeKey(key: string): { senderKey: string, sessionId: string } {
}
interface OlmSession {
session: string
sessionId: string
senderKey: string
lastUsed: number
key: string
session: string;
sessionId: string;
senderKey: string;
lastUsed: number;
key: string;
}
export class OlmSessionStore {
private _store: Store<OlmSession>
private _store: Store<OlmSession>;
constructor(store: Store<OlmSession>) {
this._store = store;

View File

@ -14,31 +14,31 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {MIN_UNICODE, MAX_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
export function encodeScopeTypeKey(scope: string, type: string): string {
return `${scope}|${type}`;
}
interface Operation {
id: string
type: string
scope: string
userIds: string[]
scopeTypeKey: string
roomKeyMessage: RoomKeyMessage
id: string;
type: string;
scope: string;
userIds: string[];
scopeTypeKey: string;
roomKeyMessage: RoomKeyMessage;
}
interface RoomKeyMessage {
room_id: string
session_id: string
session_key: string
algorithm: string
chain_index: number
room_id: string;
session_id: string;
session_key: string;
algorithm: string;
chain_index: number;
}
export class OperationStore {
private _store: Store<Operation>
private _store: Store<Operation>;
constructor(store: Store<Operation>) {
this._store = store;

View File

@ -13,16 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {Store} from "../Store";
interface OutboundSession {
roomId: string
session: string
createdAt: number
roomId: string;
session: string;
createdAt: number;
}
export class OutboundGroupSessionStore {
private _store: Store<OutboundSession>
private _store: Store<OutboundSession>;
constructor(store: Store<OutboundSession>) {
this._store = store;

View File

@ -16,20 +16,20 @@ limitations under the License.
import { encodeUint32, decodeUint32 } from "../utils";
import {KeyLimits} from "../../common";
import {Store} from "../Store"
import {Store} from "../Store";
import {Content} from "../../types";
interface PendingEntry {
roomId: string
queueIndex: number
eventType: string
content: Content
relatexTxnId: string | null
relatedEventId: string | null
txnId?: string
needsEncryption: boolean
needsUpload: boolean
key: string
roomId: string;
queueIndex: number;
eventType: string;
content: Content;
relatexTxnId: string | null;
relatedEventId: string | null;
txnId?: string;
needsEncryption: boolean;
needsUpload: boolean;
key: string;
}
function encodeKey(roomId: string, queueIndex: number): string {
@ -43,7 +43,7 @@ function decodeKey(key: string): { roomId: string, queueIndex: number } {
}
export class PendingEventStore {
private _eventStore: Store<PendingEntry>
private _eventStore: Store<PendingEntry>;
constructor(eventStore: Store<PendingEntry>) {
this._eventStore = eventStore;

View File

@ -16,7 +16,7 @@ limitations under the License.
*/
import {MAX_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
function encodeKey(roomId: string, userId: string) {
return `${roomId}|${userId}`;
@ -29,18 +29,18 @@ function decodeKey(key: string): { roomId: string, userId: string } {
// TODO: Move to RoomMember when that's TypeScript.
export interface MemberData {
roomId: string
userId: string
avatarUrl: string
displayName: string
membership: "join" | "leave" | "invite" | "ban"
roomId: string;
userId: string;
avatarUrl: string;
displayName: string;
membership: "join" | "leave" | "invite" | "ban";
}
type MemberStorageEntry = MemberData & { key: string }
// no historical members
export class RoomMemberStore {
private _roomMembersStore: Store<MemberStorageEntry>
private _roomMembersStore: Store<MemberStorageEntry>;
constructor(roomMembersStore: Store<MemberStorageEntry>) {
this._roomMembersStore = roomMembersStore;

View File

@ -24,13 +24,13 @@ function encodeKey(roomId: string, eventType: string, stateKey: string) {
}
export interface RoomStateEntry {
roomId: string,
event: StateEvent
key: string
roomId: string;
event: StateEvent;
key: string;
}
export class RoomStateStore {
private _roomStateStore: Store<RoomStateEntry>
private _roomStateStore: Store<RoomStateEntry>;
constructor(idbStore: Store<RoomStateEntry>) {
this._roomStateStore = idbStore;

View File

@ -27,12 +27,12 @@ store contains:
inviteCount
joinCount
*/
import {Store} from "../Store"
import {SummaryData} from "../../../room/RoomSummary"
import {Store} from "../Store";
import {SummaryData} from "../../../room/RoomSummary";
/** Used for both roomSummary and archivedRoomSummary stores */
export class RoomSummaryStore {
private _summaryStore: Store<SummaryData>
private _summaryStore: Store<SummaryData>;
constructor(summaryStore: Store<SummaryData>) {
this._summaryStore = summaryStore;

View File

@ -13,11 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {Store} from "../Store";
export interface SessionEntry {
key: string
value: any
key: string;
value: any;
}
export class SessionStore {

View File

@ -22,21 +22,21 @@ import {Store} from "../Store";
import {RoomEvent, StateEvent} from "../../types";
interface Annotation {
count: number
me: boolean
firstTimestamp: number
count: number;
me: boolean;
firstTimestamp: number;
}
interface StorageEntry {
roomId: string
fragmentId: number
eventIndex: number
event: RoomEvent | StateEvent
displayName?: string
avatarUrl?: string
annotations?: { [key : string]: Annotation }
key: string
eventIdKey: string
roomId: string;
fragmentId: number;
eventIndex: number;
event: RoomEvent | StateEvent;
displayName?: string;
avatarUrl?: string;
annotations?: { [key : string]: Annotation };
key: string;
eventIdKey: string;
}
function encodeKey(roomId: string, fragmentId: number, eventIndex: number): string {
@ -53,12 +53,12 @@ function decodeEventIdKey(eventIdKey: string): { roomId: string, eventId: string
}
class Range {
private _IDBKeyRange: any // TODO what's the appropriate representation here?
private _only?: EventKey
private _lower?: EventKey
private _upper?: EventKey
private _lowerOpen: boolean
private _upperOpen: boolean
private _IDBKeyRange: any; // TODO what's the appropriate representation here?
private _only?: EventKey;
private _lower?: EventKey;
private _upper?: EventKey;
private _lowerOpen: boolean;
private _upperOpen: boolean;
constructor(IDBKeyRange: any, only?: EventKey, lower?: EventKey, upper?: EventKey, lowerOpen: boolean = false, upperOpen: boolean = false) {
this._IDBKeyRange = IDBKeyRange;
@ -126,7 +126,7 @@ class Range {
* @property {?Gap} gap if a gap entry, the gap
*/
export class TimelineEventStore {
private _timelineStore: Store<StorageEntry>
private _timelineStore: Store<StorageEntry>;
constructor(timelineStore: Store<StorageEntry>) {
this._timelineStore = timelineStore;

View File

@ -20,12 +20,12 @@ import { encodeUint32 } from "../utils";
import {Store} from "../Store";
interface Fragment {
roomId: string
id: number
previousId: number | null
nextId: number | null
previousToken: string | null
nextToken: string | null
roomId: string;
id: number;
previousId: number | null;
nextId: number | null;
previousToken: string | null;
nextToken: string | null;
}
type FragmentEntry = Fragment & { key: string }
@ -35,7 +35,7 @@ function encodeKey(roomId: string, fragmentId: number): string {
}
export class TimelineFragmentStore {
private _store: Store<FragmentEntry>
private _store: Store<FragmentEntry>;
constructor(store: Store<FragmentEntry>) {
this._store = store;

View File

@ -14,17 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {MIN_UNICODE, MAX_UNICODE} from "./common";
import {Store} from "../Store"
import {Store} from "../Store";
function encodeKey(roomId: string, targetEventId: string, relType: string, sourceEventId: string): string {
return `${roomId}|${targetEventId}|${relType}|${sourceEventId}`;
}
interface RelationEntry {
roomId: string
targetEventId: string
sourceEventId: string
relType: string
roomId: string;
targetEventId: string;
sourceEventId: string;
relType: string;
}
function decodeKey(key: string): RelationEntry {
@ -33,7 +33,7 @@ function decodeKey(key: string): RelationEntry {
}
export class TimelineRelationStore {
private _store: Store<{ key: string }>
private _store: Store<{ key: string }>;
constructor(store: Store<{ key: string }>) {
this._store = store;

View File

@ -13,16 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Store} from "../Store"
import {Store} from "../Store";
interface UserIdentity {
userId: string
roomIds: string[]
deviceTrackingStatus: number
userId: string;
roomIds: string[];
deviceTrackingStatus: number;
}
export class UserIdentityStore {
private _store: Store<UserIdentity>
private _store: Store<UserIdentity>;
constructor(store: Store<UserIdentity>) {
this._store = store;

View File

@ -17,12 +17,12 @@ limitations under the License.
export type Content = { [key: string]: any }
export interface RoomEvent {
content: Content
type: string
event_id: string
sender: string
origin_server_ts: number
unsigned?: Content
content: Content;
type: string;
event_id: string;
sender: string;
origin_server_ts: number;
unsigned?: Content;
}
export type StateEvent = RoomEvent & { prev_content?: Content, state_key: string }