ConfigFacade
katanakit-js / ConfigFacade
Type Alias: ConfigFacade<T>
Section titled “Type Alias: ConfigFacade<T>”type ConfigFacade<T> = { config: ConfigData<T>;} & ConfigMethodEntries<T>;Defined in: types/core/config-facade.ts:44
What every define*Config returns: the registered config under config,
plus the methods declared alongside it so this.config resolves inside them.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Description |
|---|---|
T |
The literal passed to the define*Config call. |
Type Declaration
Section titled “Type Declaration”config
Section titled “config”config: ConfigData<T>;Props and booleans declared in the literal (methods stripped out).
Example
Section titled “Example”const api = defineApiConfig({ pokeapi: { baseUri: "…", endpoints: { users: "/users" } }, debug: true, getUsers: async function () { return this.config.debug; },});
api.config.pokeapi; // ApiEntryawait api.getUsers();