メインコンテンツまでスキップ
バージョン: v2.0

クラス: PreconditionStore

定義: src/precondition/PreconditionStore.ts:7

Precondition コンポーネントのストア。preconditions/ を走査します。

拡張

コンストラクター

コンストラクター

new PreconditionStore(): PreconditionStore;

定義: src/precondition/PreconditionStore.ts:8

戻り値

PreconditionStore

上書き

ComponentStore.constructor

プロパティ

base

readonly base: AbstractComponentClass<Precondition>;

定義: src/component/ComponentStore.ts:50

この種別のコンポーネントが継承する基底クラス。

継承元

ComponentStore.base


container

readonly container: Container;

定義: src/component/ComponentStore.ts:56

コンテナ。レジストリへの登録時に割り当てられます。

継承元

ComponentStore.container


logger

readonly logger: Logger;

定義: src/component/ComponentStore.ts:59

このストア用の子ロガー。登録時に割り当てられます。

継承元

ComponentStore.logger


name

readonly name: string;

定義: src/component/ComponentStore.ts:47

ストア名(= 自動探索ディレクトリ名)。

継承元

ComponentStore.name


suffix

readonly suffix: string;

定義: src/component/ComponentStore.ts:53

クラス名から取り除く接尾辞(ComponentStoreOptions.suffix)。

継承元

ComponentStore.suffix

メソッド

applyOptions()

protected applyOptions(component, options): void;

定義: src/component/ComponentStore.ts:238

解決済みメタデータをインスタンスへ適用します — 種別固有フィールドの 割り当てと必須項目の検証はここで行います。ロード時に弾く場合は (ComponentLoadError を推奨)例外を投げてください。

パラメータ

component

Precondition

options

ComponentOptions

戻り値

void

継承元

ComponentStore.applyOptions


bind()

protected bind(component): void;

定義: src/component/ComponentStore.ts:247

ロード済みコンポーネントをランタイムへ配線します(例: リスナーの イベント購読)。onLoad の後、ストアに追加された状態で呼ばれます。

パラメータ

component

Precondition

戻り値

void

継承元

ComponentStore.bind


deriveName()

protected deriveName(className): string;

定義: src/precondition/PreconditionStore.ts:17

Precondition 名は Preconditions インターフェースのキーと 一致させるため、大文字小文字を保持します (OwnerOnlyPreconditionOwnerOnly)。

パラメータ

className

string

戻り値

string

上書き

ComponentStore.deriveName


load()

load(cls, location?): Promise<Precondition>;

定義: src/component/ComponentStore.ts:122

単一のコンポーネントクラスを構築・初期化・追加します。 同じクラスの二重ロードは既存インスタンスを返すだけで無害です。 別の クラスが既存の名前に解決された場合は ComponentLoadError を投げます。

パラメータ

cls

ComponentClass<Precondition>

location?

string | null

戻り値

Promise<Precondition>

継承元

ComponentStore.load


loadAll()

loadAll(baseDirectory): Promise<void>;

定義: src/component/ComponentStore.ts:95

この種別のすべてのコンポーネントをロードします: 先に明示登録分、 次に <baseDirectory>/<name> のファイル自動探索(baseDirectory 設定時)。 クライアント起動時にレジストリから呼ばれます。

パラメータ

baseDirectory

string | null

戻り値

Promise<void>

継承元

ComponentStore.loadAll


register()

register(...classes): this;

定義: src/component/ComponentStore.ts:77

コンポーネントクラスを明示登録します(ファイル自動探索の代替)。 ComponentStore.loadAll 前ならキューに積まれ、後なら即座に ロードされます(fire-and-forget — インスタンスを待つ場合は ComponentStore.load を使ってください)。

パラメータ

classes

...ComponentClass<Precondition>[]

戻り値

this

継承元

ComponentStore.register


run()

run(names, payload): Promise<PreconditionResult>;

定義: src/precondition/PreconditionStore.ts:31

コマンド呼び出しに対して指定された Precondition を順番に実行し、 最初の拒否で停止します。

パラメータ

names

readonly string[]

payload

CommandRunPayload & object

戻り値

Promise<PreconditionResult>

Throws

FrameworkError 呼び出されたフローを Precondition が実装して いない場合。設定ミスは黙って通過させず、明示的に失敗させます。


unbind()

protected unbind(component): void;

定義: src/component/ComponentStore.ts:252

ComponentStore.bind の逆操作。アンロード時に呼ばれます。

パラメータ

component

Precondition

戻り値

void

継承元

ComponentStore.unbind


unload()

unload(resolvable): Promise<Precondition>;

定義: src/component/ComponentStore.ts:200

コンポーネントを取り除きます(ComponentStore.unbindonUnload を実行)。

パラメータ

resolvable

string | Precondition

戻り値

Promise<Precondition>

継承元

ComponentStore.unload


unloadAll()

unloadAll(): Promise<void>;

定義: src/component/ComponentStore.ts:217

このストアのすべてのコンポーネントをアンロードします(クライアント終了時に使用)。

戻り値

Promise<void>

継承元

ComponentStore.unloadAll