import { type GetTokenParams } from "@whop-apps/auth"; import { type ClientOptions, type FetchResponse, type HeadersOptions } from "@whop-apps/typed-api"; import type { paths } from "./schema"; type Entity = "me" | "app" | "company"; type ApiPaths = { [Path in keyof paths as Path extends `/v5${infer P}` ? P : Path]: paths[Path]; }; type FilterPathsByAvailability = { [Path in keyof ApiPaths as A extends "misc" ? Path extends `/${Entity}` | `/${Entity}/${string}` ? never : Path : Path extends `/${A}` | `/${A}/${string}` ? Path : never]: ApiPaths[Path]; }; export declare const makeApi: ({ baseHeaders, customClientOptions, }: { baseHeaders: HeadersOptions; availability: A; customClientOptions?: Partial | undefined; }) => { GET

, "get">>(url: P, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P], "get">>>): Promise[P] ? FilterPathsByAvailability[P][keyof FilterPathsByAvailability[P] & "get"] : unknown>>; PUT, "put">>(url: P_1, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_1], "put">>>): Promise[P_1] ? FilterPathsByAvailability[P_1][keyof FilterPathsByAvailability[P_1] & "put"] : unknown>>; POST, "post">>(url: P_2, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_2], "post">>>): Promise[P_2] ? FilterPathsByAvailability[P_2][keyof FilterPathsByAvailability[P_2] & "post"] : unknown>>; DELETE, "delete">>(url: P_3, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_3], "delete">>>): Promise[P_3] ? FilterPathsByAvailability[P_3][keyof FilterPathsByAvailability[P_3] & "delete"] : unknown>>; OPTIONS, "options">>(url: P_4, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_4], "options">>>): Promise[P_4] ? FilterPathsByAvailability[P_4][keyof FilterPathsByAvailability[P_4] & "options"] : unknown>>; HEAD, "head">>(url: P_5, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_5], "head">>>): Promise[P_5] ? FilterPathsByAvailability[P_5][keyof FilterPathsByAvailability[P_5] & "head"] : unknown>>; PATCH, "patch">>(url: P_6, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_6], "patch">>>): Promise[P_6] ? FilterPathsByAvailability[P_6][keyof FilterPathsByAvailability[P_6] & "patch"] : unknown>>; TRACE, "trace">>(url: P_7, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_7], "trace">>>): Promise[P_7] ? FilterPathsByAvailability[P_7][keyof FilterPathsByAvailability[P_7] & "trace"] : unknown>>; }; export declare function me(opts: (GetTokenParams | Record) & Partial> & { customHeaders?: ClientOptions["headers"]; }): ReturnType>; export declare function app(opts?: { apiKey?: string; } & Partial): { GET

, "get">>(url: P, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P], "get">>>): Promise[P] ? FilterPathsByAvailability<"app">[P][keyof FilterPathsByAvailability<"app">[P] & "get"] : unknown>>; PUT(url: P_1, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_1], "put">>>): Promise[P_1] ? FilterPathsByAvailability<"app">[P_1][keyof FilterPathsByAvailability<"app">[P_1] & "put"] : unknown>>; POST, "post">>(url: P_2, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_2], "post">>>): Promise[P_2] ? FilterPathsByAvailability<"app">[P_2][keyof FilterPathsByAvailability<"app">[P_2] & "post"] : unknown>>; DELETE, "delete">>(url: P_3, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_3], "delete">>>): Promise[P_3] ? FilterPathsByAvailability<"app">[P_3][keyof FilterPathsByAvailability<"app">[P_3] & "delete"] : unknown>>; OPTIONS(url: P_4, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_4], "options">>>): Promise[P_4] ? FilterPathsByAvailability<"app">[P_4][keyof FilterPathsByAvailability<"app">[P_4] & "options"] : unknown>>; HEAD(url: P_5, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_5], "head">>>): Promise[P_5] ? FilterPathsByAvailability<"app">[P_5][keyof FilterPathsByAvailability<"app">[P_5] & "head"] : unknown>>; PATCH, "patch">>(url: P_6, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_6], "patch">>>): Promise[P_6] ? FilterPathsByAvailability<"app">[P_6][keyof FilterPathsByAvailability<"app">[P_6] & "patch"] : unknown>>; TRACE(url: P_7, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_7], "trace">>>): Promise[P_7] ? FilterPathsByAvailability<"app">[P_7][keyof FilterPathsByAvailability<"app">[P_7] & "trace"] : unknown>>; }; export declare function company(opts?: { apiKey?: string; } & Partial): { GET

, "get">>(url: P, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P], "get">>>): Promise[P] ? FilterPathsByAvailability<"company">[P][keyof FilterPathsByAvailability<"company">[P] & "get"] : unknown>>; PUT(url: P_1, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_1], "put">>>): Promise[P_1] ? FilterPathsByAvailability<"company">[P_1][keyof FilterPathsByAvailability<"company">[P_1] & "put"] : unknown>>; POST(url: P_2, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_2], "post">>>): Promise[P_2] ? FilterPathsByAvailability<"company">[P_2][keyof FilterPathsByAvailability<"company">[P_2] & "post"] : unknown>>; DELETE(url: P_3, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_3], "delete">>>): Promise[P_3] ? FilterPathsByAvailability<"company">[P_3][keyof FilterPathsByAvailability<"company">[P_3] & "delete"] : unknown>>; OPTIONS(url: P_4, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_4], "options">>>): Promise[P_4] ? FilterPathsByAvailability<"company">[P_4][keyof FilterPathsByAvailability<"company">[P_4] & "options"] : unknown>>; HEAD(url: P_5, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_5], "head">>>): Promise[P_5] ? FilterPathsByAvailability<"company">[P_5][keyof FilterPathsByAvailability<"company">[P_5] & "head"] : unknown>>; PATCH(url: P_6, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_6], "patch">>>): Promise[P_6] ? FilterPathsByAvailability<"company">[P_6][keyof FilterPathsByAvailability<"company">[P_6] & "patch"] : unknown>>; TRACE(url: P_7, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional[P_7], "trace">>>): Promise[P_7] ? FilterPathsByAvailability<"company">[P_7][keyof FilterPathsByAvailability<"company">[P_7] & "trace"] : unknown>>; }; export {}; //# sourceMappingURL=api.d.ts.map