import type { HttpClient as Transport } from '../client/http.js'; type ResourceName = 'game' | 'league' | 'team' | 'player' | 'transaction'; type CollectionName = 'users' | 'games' | 'leagues' | 'teams' | 'players' | 'transactions'; type SubResourceName = 'roster' | 'stats' | 'matchups' | 'ownership' | 'percent_owned'; type KeysParam = T extends `${infer Stem}s` ? `${Stem}_keys` : `${T}_keys`; /** * Parameters for addressing a single Yahoo Fantasy resource instance. */ export type ResourceParams = { kind: 'resource'; name: ResourceName; key: TKey; out: TSubResource[]; }; /** * Parameters for addressing a Yahoo Fantasy resource collection. */ export type CollectionParams = { kind: 'collection'; name: CollectionName; out: TSubResource[]; } & Partial : Record, TKey[]>>; export type SubResourceParams = { kind: 'subResource'; name: TSubResourceName; }; /** * Immutable request state accumulated while building a resource path. */ export interface RequestState { segments: string[]; } type Scalar = string | number | boolean; type PathValue = Scalar | null | undefined | readonly Scalar[]; type HttpMethod = 'get' | 'post' | 'put' | 'delete'; /** * Base abstraction for a Yahoo Fantasy API resource path builder. * * It stores the current path state, supports adding sub-resources, and * serializes resource parameters into Yahoo's semicolon-delimited path format. */ export declare abstract class Resource { protected readonly _transport: Transport; protected readonly _state: RequestState; protected readonly _params: TParams; protected constructor(_transport: Transport, _state: RequestState, _params: TParams); protected clone(params: TParams): this; /** * Returns the full request path for the current resource state. */ toPath(): string; /** * Returns the parameter state after applying a partial update. */ params(params: Partial): this; protected cloneWith(patch: Partial): this; protected createChildState(): RequestState; get(): Promise; protected post(body?: Record | string): Promise; protected put(body?: Record | string): Promise; protected delete(): Promise; protected request(method: 'get', body?: Record | string): Promise; protected request(method: Exclude, body?: Record | string): Promise; private performRequest; /** * Serializes the current resource identifier and any path parameters. */ protected serialize(): string; /** * Serializes all non-structural params into Yahoo path segments. */ protected serializeParams(params: Record): string; /** * Serializes a single parameter using Yahoo's semicolon-delimited syntax. */ protected serializeParam(key: string, value: PathValue): string; } export {}; //# sourceMappingURL=resource.d.ts.map