import type { MaybePromise, ResourceCompletionResult, ResourceCompletionResultLike } from "./utils"; type ExtractParams = T extends `${infer _Start}{${infer Param}}${infer Rest}` ? { [K in Param | keyof ExtractParams]: string; } : {}; export type TResourceUri = `${string}://${string}`; export declare function extractParamValues(template: string, actual: string): Record; export declare function matchPath(template: string, actual: string): boolean; export type ResourceConfig = { mimeType?: string; title?: string; description?: string; size?: number; list?: MaybePromise; complete?: { [key: string]: (value: string, context: any) => MaybePromise; }; _meta?: { [key: string]: unknown; }; }; export type ResourceHandlerCtx = { text: (text: string, opts?: ResourceResponse) => ResourceResponse; json: (json: object, opts?: ResourceResponse) => ResourceResponse; binary: (binary: Uint8Array, opts?: ResourceResponse) => ResourceResponse; context: Context; uri: TResourceUri; raw?: unknown; }; export type ResourceHandler = (ctx: ResourceHandlerCtx, params: Uri extends TResourceUri ? ExtractParams : never) => MaybePromise; export type ResourceResponse = { mimeType?: string; title?: string; description?: string; } & ({ text?: string; } | { blob?: string; }); export type ResourceJson = ReturnType; export declare class Resource : never> { readonly name: Name; readonly uri: Uri; readonly handler: (ctx: ResourceHandlerCtx, params: Params) => MaybePromise; readonly options: ResourceConfig; constructor(name: Name, uri: Uri, handler: (ctx: ResourceHandlerCtx, params: Params) => MaybePromise, options?: ResourceConfig); isDynamic(): boolean; matches(uri: Uri): boolean; suggest(name: string, value: string, context: object): Promise; call(uri: TResourceUri, context: Context, raw?: unknown): Promise; toJSONContent(context: Context, uri?: TResourceUri, request?: Request): Promise<{ mimeType: string; title?: string; description?: string; text?: string; uri: `${string}://${string}`; name: string; size: number | undefined; _meta: { [key: string]: unknown; } | undefined; } | { mimeType: string; title?: string; description?: string; blob?: string; uri: `${string}://${string}`; name: string; size: number | undefined; _meta: { [key: string]: unknown; } | undefined; }>; toJSON(): { [x: string]: string | number | { [key: string]: unknown; } | undefined; name: Name; title: string | undefined; description: string | undefined; mimeType: string | undefined; size: number | undefined; _meta: { [key: string]: unknown; } | undefined; }; } export {};