@worker-tools/middleware
Version:
A suite of standalone HTTP server middlewares for Worker Runtimes.
33 lines (32 loc) • 1.84 kB
TypeScript
import { CookieStore, CookieListItem, CookieInit, CookieList, CookieStoreDeleteOptions, CookieStoreGetOptions } from "@worker-tools/request-cookie-store";
import { Cookies } from "../cookies.js";
/**
* A more opinionated cookie store implementation that
* - URI-(en|de)codes cookie values and
* - provides a promise that resolves when all async operations associated with this store have settled.
*/
export declare class MiddlewareCookieStore implements CookieStore {
#private;
constructor(store: CookieStore, requestDuration: Promise<void>);
get(name?: string): Promise<CookieListItem | null>;
get(options?: CookieStoreGetOptions): Promise<CookieListItem | null>;
getAll(name?: string): Promise<CookieList>;
getAll(options?: CookieStoreGetOptions): Promise<CookieList>;
set(name: string, value: string): Promise<void>;
set(options: CookieInit): Promise<void>;
delete(name: string): Promise<void>;
delete(options: CookieStoreDeleteOptions): Promise<void>;
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
dispatchEvent(event: Event): boolean;
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
/** @deprecated Name of this property might change */
get settled(): boolean;
/** @deprecated Name of this property might change */
get allSettledPromise(): Promise<import("@worker-tools/extendable-promise").PromiseSettledResult<void>[]>;
/**
* If you've made changes to the store and would like to access the current cookies as an object,
* it is provided as a promise here (TODO:)
* @deprecated This method might change names
*/
get updatedCookies(): Promise<Cookies>;
}