Iterate
This commit is contained in:
@@ -18,22 +18,28 @@
|
|||||||
"lint:ts": "tsc --noEmit"
|
"lint:ts": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@matrix-org/react-sdk-module-api": "^2.5.0",
|
||||||
"@types/node": "^22.10.7",
|
"@types/node": "^22.10.7",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
|
"matrix-web-i18n": "^3.3.0",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
"vite": "^6.0.11",
|
"vite": "^6.0.11",
|
||||||
"vite-plugin-dts": "^4.5.0"
|
"vite-plugin-dts": "^4.5.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@matrix-org/react-sdk-module-api": "^2.5.0",
|
"@matrix-org/react-sdk-module-api": "*",
|
||||||
"@types/react": "*",
|
"@types/react": "*",
|
||||||
"@types/react-dom": "*",
|
"@types/react-dom": "*",
|
||||||
|
"matrix-web-i18n": "*",
|
||||||
"react": "^18"
|
"react": "^18"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@matrix-org/react-sdk-module-api": {
|
"@matrix-org/react-sdk-module-api": {
|
||||||
"optional": true
|
"optional": true
|
||||||
|
},
|
||||||
|
"matrix-web-i18n": {
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const moduleExportSignature: Record<keyof ModuleExport, Type> = {
|
|||||||
|
|
||||||
type Type = "function" | "string" | "number" | "boolean" | "object";
|
type Type = "function" | "string" | "number" | "boolean" | "object";
|
||||||
|
|
||||||
export function isInterface<T>(obj: unknown, keys: Record<keyof T, Type>): obj is T {
|
function isInterface<T>(obj: unknown, keys: Record<keyof T, Type>): obj is T {
|
||||||
if (obj === null || typeof obj !== "object") return false;
|
if (obj === null || typeof obj !== "object") return false;
|
||||||
for (const key in keys) {
|
for (const key in keys) {
|
||||||
if (typeof (obj as Record<keyof T, unknown>)[key] !== keys[key]) return false;
|
if (typeof (obj as Record<keyof T, unknown>)[key] !== keys[key]) return false;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE files in the repository root for full details.
|
Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { ModuleLoader } from "./loader";
|
export { ModuleLoader, ModuleIncompatibleError } from "./loader";
|
||||||
export type { Api, Module, ModuleFactory } from "./api";
|
export type { Api, Module, ModuleFactory } from "./api";
|
||||||
export type * from "./legacy-modules";
|
export type * from "./legacy-modules";
|
||||||
export type * from "./legacy-customisations";
|
export type * from "./legacy-customisations";
|
||||||
|
|||||||
Reference in New Issue
Block a user