diff --git a/index.d.ts b/index.d.ts index 7292c2f..992dbbc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ interface ComponentSettings { - [key: string]: any + [key: string]: unknown } interface ClientSetOptions { @@ -15,7 +15,7 @@ type WidgetCallback = () => Promise interface MCEvent { readonly name?: string - readonly payload: any + readonly payload: unknown client: Client readonly type: string } @@ -54,19 +54,22 @@ interface Manager { type: ClientEventType, callback: MCEventListener ): boolean | undefined - get(key: string): Promise - set(key: string, value: any): Promise + get(key: string): Promise + set(key: string, value: unknown): Promise route( path: string, - callback: (request: Request | any) => Promise | Response + callback: (request: Request | unknown) => Promise | Response ): string | undefined proxy(path: string, target: string): string | undefined serve(path: string, target: string): string | undefined - useCache(key: string, callback: Function, expiry?: number): Promise + useCache(key: string, callback: Function, expiry?: number): Promise invalidateCache(key: string): Promise registerEmbed(name: string, callback: EmbedCallback): boolean | undefined registerWidget(callback: WidgetCallback): boolean | undefined - fetch(input: RequestInfo | URL, init?: RequestInit): Promise | undefined + fetch( + input: RequestInfo | URL, + init?: RequestInit + ): Promise | undefined } interface Client { @@ -109,7 +112,7 @@ type Permission = | 'client_network_requests' | 'serve_static_files' | 'provide_server_functionality' - | "server_network_requests" + | 'server_network_requests' export { ComponentSettings,