matrix-js-sdk
matrix-js-sdk copied to clipboard
IPreviewUrlResponse in client.d.ts has invalid types
The current (18.1.0) exported types for the interface are as follows:
export interface IPreviewUrlResponse {
[key: string]: string | number;
"og:title": string;
"og:type": string;
"og:url": string;
"og:image"?: string;
"og:image:type"?: string;
"og:image:height"?: number;
"og:image:width"?: number;
"og:description"?: string;
"matrix:image:size"?: number;
}
However, the undefined values do not satisfy the index constraint which leads to Typescript complaining that:
node_modules/matrix-js-sdk/lib/client.d.ts:305:5 - error TS2411: Property '"og:image:type"' of type 'string | undefined' is not assignable to 'string' index type 'string | number'.
Cannot reproduce this on replit
https://replit.com/@t3chguy/WhimsicalAnxiousLinks#index.ts