Documentation
    Preparing search index...

    Interface ResourceServiceOptions

    Options for createResourceService (options-as-bridge per v1.6 Decision 18).

    fetch is the only required field. Kehto does not select a runtime's scheme or origin policy.

    interface ResourceServiceOptions {
        resourceInfo?: ResourceInfoProvider;
        fetch(url: string, init: ResourceFetchInit): Promise<Response>;
        stream?(url: string, init: ResourceFetchInit): Promise<Response>;
    }
    Index

    Properties

    Methods

    Properties

    resourceInfo?: ResourceInfoProvider

    Advisory NAP-RESOURCE introspection exposed through resource.info.

    Provide a static snapshot or a resolver when the shell wants to disclose configured schemes and coarse limits. Scheme disclosure is advisory and is never used as fetch authorization. Omit to disclose no schemes or limits.

    Methods

    • Runtime-supplied resource resolver. Receives the requested URL and returns a byte-classified Response.

      The runtime owns scheme dispatch and every NAP-RESOURCE policy decision. The returned content-type must describe the runtime-classified bytes, not an untrusted upstream header. Throw ResourceServiceError to preserve a canonical protocol error classification.

      Parameters

      • url: string

        The URL from the resource.bytes request

      • init: ResourceFetchInit

        Read-only method, request-scoped AbortSignal, and actual-destination approval callback

      Returns Promise<Response>