Skip to content
0

katanakit-js / ConfigFacade

Type Alias: ConfigFacade<T> ​

ts
type ConfigFacade<T> = {
  config: ConfigData<T>;
} & ConfigMethodEntries<T>;

Defined in: src/types/index.ts:1531

What every define*Config returns: the registered config under config, plus the methods declared alongside it so this.config resolves inside them.

Type Declaration ​

config ​

ts
config: ConfigData<T>;

Props and booleans declared in the literal (methods stripped out).

Type Parameters ​

Type ParameterDescription
TThe literal passed to the define*Config call.

Example ​

ts
const api = defineApiConfig({
  pokeapi: { baseUri: "…", endpoints: { users: "/users" } },
  debug: true,
  getUsers: async function () {
    return this.config.debug;
  },
});

api.config.pokeapi; // ApiEntry
await api.getUsers();

Released under the MIT License.