From 0861b2db40aebe6b09582683049193c3ca9fd1fe Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 16 Aug 2021 14:19:10 -0700 Subject: [PATCH] Update TypeScript --- lib/common/authorizer.ts | 8 ++++---- lib/common/boolean-expression.ts | 20 ++++++++++---------- lib/common/path-set.ts | 6 +++--- lib/common/path.ts | 10 +++++----- lib/instance-set.ts | 2 +- lib/versioned-map.ts | 8 ++++---- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- ui/autocomplete-compnent.ts | 14 +++++++------- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/common/authorizer.ts b/lib/common/authorizer.ts index b35da99..0d7929c 100644 --- a/lib/common/authorizer.ts +++ b/lib/common/authorizer.ts @@ -21,13 +21,13 @@ import { PermissionSet, Expression } from "../types"; import { evaluate, or } from "./expression"; export default class Authorizer { - private permissionSets: PermissionSet[]; - private validatorCache: WeakMap< + private declare permissionSets: PermissionSet[]; + private declare validatorCache: WeakMap< any, (mutationType, mutation, any) => boolean >; - private hasAccessCache: Map; - private getFilterCache: Map; + private declare hasAccessCache: Map; + private declare getFilterCache: Map; public constructor(permissionSets: PermissionSet[]) { this.permissionSets = permissionSets; diff --git a/lib/common/boolean-expression.ts b/lib/common/boolean-expression.ts index e073818..f888e60 100644 --- a/lib/common/boolean-expression.ts +++ b/lib/common/boolean-expression.ts @@ -29,8 +29,8 @@ const TWO = BI.BigInt(2); const NEGATIVE_ONE = BI.BigInt(-1); class Indeterminates { - public map: Map; - public sortedKeys: string[]; + public declare map: Map; + public declare sortedKeys: string[]; public constructor(str?: string) { this.map = new Map(); @@ -118,7 +118,7 @@ function findGcd(a: BI.bigint, b: BI.bigint): BI.bigint { } class Polynomial { - public terms: Term[]; + public declare terms: Term[]; public constructor(terms: Term[]) { this.terms = terms; @@ -343,8 +343,8 @@ class NullSynth extends BoolExprSynth { } class VarSynth extends BoolExprSynth { - private expStr: string; - private negate: boolean; + private declare expStr: string; + private declare negate: boolean; public constructor(exp: Expression) { super(); this.negate = false; @@ -388,7 +388,7 @@ class VarSynth extends BoolExprSynth { } class NotSynth extends BoolExprSynth { - private exprSynth: BoolExprSynth; + private declare exprSynth: BoolExprSynth; public constructor(e: BoolExprSynth) { super(); this.exprSynth = e; @@ -405,7 +405,7 @@ class NotSynth extends BoolExprSynth { } class IsNullSynth extends BoolExprSynth { - private exprSynth: BoolExprSynth; + private declare exprSynth: BoolExprSynth; public constructor(e: BoolExprSynth) { super(); this.exprSynth = e; @@ -422,7 +422,7 @@ class IsNullSynth extends BoolExprSynth { } class OrSynth extends BoolExprSynth { - private exprSynths: BoolExprSynth[]; + private declare exprSynths: BoolExprSynth[]; public constructor(...e: BoolExprSynth[]) { super(); this.exprSynths = e.filter((ee) => !(ee instanceof FalseSynth)); @@ -465,7 +465,7 @@ class OrSynth extends BoolExprSynth { } class AndSynth extends BoolExprSynth { - private exprSynths: BoolExprSynth[]; + private declare exprSynths: BoolExprSynth[]; public constructor(...e: BoolExprSynth[]) { super(); this.exprSynths = e.filter((ee) => !(ee instanceof TrueSynth)); @@ -508,7 +508,7 @@ class AndSynth extends BoolExprSynth { } class CaseSynth extends BoolExprSynth { - private exprSynths: BoolExprSynth[]; + private declare exprSynths: BoolExprSynth[]; public constructor(e: BoolExprSynth[]) { super(); this.exprSynths = e; diff --git a/lib/common/path-set.ts b/lib/common/path-set.ts index 4197536..9667917 100644 --- a/lib/common/path-set.ts +++ b/lib/common/path-set.ts @@ -20,9 +20,9 @@ import Path from "./path"; export default class PathSet { - private lengthIndex: Set[]; - private fragmentIndex: Map>[]; - private stringIndex: Map; + private declare lengthIndex: Set[]; + private declare fragmentIndex: Map>[]; + private declare stringIndex: Map; public constructor() { this.lengthIndex = []; diff --git a/lib/common/path.ts b/lib/common/path.ts index a79345c..dc463bd 100644 --- a/lib/common/path.ts +++ b/lib/common/path.ts @@ -49,11 +49,11 @@ function legalChar(c: number): boolean { } export default class Path { - public readonly segments: Segments; - public readonly wildcard: number; - public readonly alias: number; - protected _string: string; - protected _stringIndex: number[]; + public declare readonly segments: Segments; + public declare readonly wildcard: number; + public declare readonly alias: number; + protected declare _string: string; + protected declare _stringIndex: number[]; protected static parseAliasValue( pattern: string, diff --git a/lib/instance-set.ts b/lib/instance-set.ts index 8724f96..f633efc 100644 --- a/lib/instance-set.ts +++ b/lib/instance-set.ts @@ -22,7 +22,7 @@ interface Instance { } export default class InstanceSet { - private set: Set; + private declare set: Set; public constructor() { this.set = new Set(); diff --git a/lib/versioned-map.ts b/lib/versioned-map.ts index 52e38b3..5773933 100644 --- a/lib/versioned-map.ts +++ b/lib/versioned-map.ts @@ -26,10 +26,10 @@ interface Revisions { } export default class VersionedMap { - private _sizeDiff: number[]; - private _revision: number; - private map: Map; - public dirty: number; + private declare _sizeDiff: number[]; + private declare _revision: number; + private declare map: Map; + public declare dirty: number; public constructor() { this._sizeDiff = [0]; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 971a8c8..8aa2aed 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -11118,9 +11118,9 @@ } }, "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", + "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 77fcc64..8acd762 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "rollup-plugin-terser": "^7.0.2", "svgo": "^2.2.2", "ts-node": "^9.1.1", - "typescript": "^4.2.3", + "typescript": "^4.3.5", "yaml": "^1.10.0" }, "engines": { diff --git a/ui/autocomplete-compnent.ts b/ui/autocomplete-compnent.ts index 08b4479..c32d99b 100644 --- a/ui/autocomplete-compnent.ts +++ b/ui/autocomplete-compnent.ts @@ -23,13 +23,13 @@ type AutocompleteCallback = ( ) => void; export default class Autocomplete { - private callback: AutocompleteCallback; - private element: HTMLInputElement; - private hideTimeout: NodeJS.Timeout; - private visible: boolean; - private default: string; - private selection: number; - private container: HTMLElement; + private declare callback: AutocompleteCallback; + private declare element: HTMLInputElement; + private declare hideTimeout: NodeJS.Timeout; + private declare visible: boolean; + private declare default: string; + private declare selection: number; + private declare container: HTMLElement; public constructor(className: string, callback: AutocompleteCallback) { this.callback = callback;