@prismshadow/penguin-server · packages/server/src/plugin/config.ts:834

PluginConfig

interface

What a module reads: the group it declared, and a watch on it.

API

@Interface()
export abstract class PluginConfig {
  abstract get(name: string): Record<string, unknown>;
  abstract watch(name: string, cb: (values: Record<string, unknown>) => void): () => void;
  abstract saved(name: string): boolean;
  abstract schema(name: string): PluginConfiguration | undefined;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use

Members (4)

get

get(name: string): Record<string, unknown>

The stored values merged onto the declared defaults; {} for a name no group answers to.

@paramnamestring
@returnsRecord<string, unknown>

watch

watch(name: string, cb: (values: Record<string, unknown>) => void): () => void

Fires with the new document after every save of name; returns the unsubscribe.

@paramnamestring
@paramcb(values: Record<string, unknown>) => void
@returns() => void

saved

saved(name: string): boolean

Whether anything was ever saved under name — what tells a default from a choice.

@paramnamestring
@returnsboolean

schema

schema(name: string): PluginConfiguration | undefined

The configuration name was declared with (what resolveTable reads a table by); undefined for none.

@paramnamestring
@returnsPluginConfiguration | undefined