Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created September 12, 2018 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamincharity/df36ed56bb2ff04e4484e861af77b22b to your computer and use it in GitHub Desktop.
Save benjamincharity/df36ed56bb2ff04e4484e861af77b22b to your computer and use it in GitHub Desktop.
TS 2.9 keyof error
BUILD ERROR
ngx-tools/src/jwt-token-managment/reducer.ts(33,7): error TS2536: Type 'keyof C' cannot be used to index type '{ [x: string]: string; }'.
ngx-tools/src/jwt-token-managment/utilities/token-extractor.mock.ts(34,10): error TS2416: Property 'extractJwtToken' in type 'TokenExtractorMock<CM>' is not assignable to the same property in base type 'TokenExtractor<ClaimMap>'.
Type '<T extends Object | HttpResponse<any>>({ tokenName, isDefaultToken }: ExtractTokenParams<CM>) => ...' is not assignable to type '<T extends Object | HttpResponse<any>>({ tokenName, resetAllOtherTokens, isDefaultToken }: Extrac...'.
Types of parameters '__0' and '__0' are incompatible.
Type 'ExtractTokenParams<ClaimMap>' is not assignable to type 'ExtractTokenParams<CM>'.
Types of property 'tokenName' are incompatible.
Type 'string | number' is not assignable to type 'keyof CM'.
Type 'string' is not assignable to type 'keyof CM'.
ngx-tools/src/jwt-token-managment/utilities/retry-with-escalation.mock.ts(37,10): error TS2416: Property 'retryWithEscalation' in type 'RetryWithEscalationMock<CM>' is not assignable to the same property in base type 'RetryWithEscalation<ClaimMap>'.
Type '(tokenName: keyof CM) => (source: Observable<any>) => Observable<any>' is not assignable to type '(tokenName: string | number) => (source: Observable<any>) => Observable<any>'.
ngx-tools/src/jwt-token-managment/utilities/retry-with-escalation.mock.ts(37,10): error TS2416: Property 'retryWithEscalation' in type 'RetryWithEscalationMock<CM>' is not assignable to the same property in base type 'RetryWithEscalation<ClaimMap>'.
Type '(tokenName: keyof CM) => (source: Observable<any>) => Observable<any>' is not assignable to type '(tokenName: string | number) => (source: Observable<any>) => Observable<any>'.
Types of parameters 'tokenName' and 'tokenName' are incompatible.
Type 'string | number' is not assignable to type 'keyof CM'.
Type 'string' is not assignable to type 'keyof CM'.
ngx-tools/src/jwt-token-managment/utilities/retry-with-escalation.mock.ts(54,51): error TS2345: Argument of type 'keyof CM' is not assignable to parameter of type 'string'.
Type 'string | number | symbol' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(49,9): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: Observer<any>; }'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(50,7): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: Observer<any>; }'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(58,7): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: Observer<any>; }'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(65,16): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: string[]; }'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(66,13): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: string[]; }'.
ngx-tools/src/jwt-token-managment/utilities/token-escalator.mock.ts(69,11): error TS2536: Type 'keyof CM' cannot be used to index type '{ [idx: string]: string[]; }'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment