rest-vir - v1.0.0
    Preparing search index...

    Type Alias EndpointImplementationParams<Context, SpecificEndpoint, ServiceName>

    The object that all endpoint implementations receive as an input.

    type EndpointImplementationParams<
        Context = any,
        SpecificEndpoint extends EndpointDefinition | NoParam = NoParam,
        ServiceName extends string = any,
    > = {
        context: NoInfer<Context>;
        endpoint: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
            ? EndpointDefinition
            : SpecificEndpoint;
        log: Readonly<ServiceLogger>;
        method: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
            ? HttpMethod
            : ExtractKeysWithMatchingValues<
                Exclude<SpecificEndpoint, NoParam>["methods"],
                true,
            > extends infer AvailableMethod
                ? IsNever<AvailableMethod> extends true ? HttpMethod : AvailableMethod
                : never;
        pathParams: SpecificEndpoint extends NoParam
            ? Readonly<Record<string, string>>
            : PathParams<Exclude<SpecificEndpoint, NoParam>["path"]> extends string
                ? Readonly<
                    Record<
                        PathParams<Exclude<SpecificEndpoint, NoParam>["path"]>,
                        string,
                    >,
                >
                : Readonly<Record<string, string>>;
        request: ServerRequest;
        requestData: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
            ? any
            : WithFinalEndpointProps<Exclude<SpecificEndpoint, NoParam>, any>["RequestType"];
        requestHeaders: IncomingHttpHeaders;
        response: ServerResponse;
        searchParams: ReplaceUndefinedWithEmptyObject<
            SpecificEndpoint extends NoParam
                ? BaseSearchParams
                : Exclude<SpecificEndpoint, NoParam>["SearchParamsType"],
        >;
        server: RunningServerInfo;
        service: MinimalService<ServiceName>;
    }

    Type Parameters

    Index

    Properties

    context: NoInfer<Context>
    endpoint: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
        ? EndpointDefinition
        : SpecificEndpoint
    log: Readonly<ServiceLogger>
    method: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
        ? HttpMethod
        : ExtractKeysWithMatchingValues<
            Exclude<SpecificEndpoint, NoParam>["methods"],
            true,
        > extends infer AvailableMethod
            ? IsNever<AvailableMethod> extends true ? HttpMethod : AvailableMethod
            : never
    pathParams: SpecificEndpoint extends NoParam
        ? Readonly<Record<string, string>>
        : PathParams<Exclude<SpecificEndpoint, NoParam>["path"]> extends string
            ? Readonly<
                Record<PathParams<Exclude<SpecificEndpoint, NoParam>["path"]>, string>,
            >
            : Readonly<Record<string, string>>
    request: ServerRequest
    requestData: IsEqual<Extract<SpecificEndpoint, NoParam>, NoParam> extends true
        ? any
        : WithFinalEndpointProps<Exclude<SpecificEndpoint, NoParam>, any>["RequestType"]
    requestHeaders: IncomingHttpHeaders
    response: ServerResponse
    searchParams: ReplaceUndefinedWithEmptyObject<
        SpecificEndpoint extends NoParam
            ? BaseSearchParams
            : Exclude<SpecificEndpoint, NoParam>["SearchParamsType"],
    >

    The actual running server info.