@xyo-network/module-abstract 2.72.8 → 2.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{types/AbstractModule.d.ts → index.d.mts} +87 -8
- package/dist/index.d.ts +163 -0
- package/dist/index.js +8521 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8490 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -35
- package/src/AbstractModule.ts +1 -1
- package/tsup.config.ts +16 -0
- package/dist/cjs/AbstractModule.js +0 -542
- package/dist/cjs/AbstractModule.js.map +0 -1
- package/dist/cjs/AbstractModuleInstance.js +0 -41
- package/dist/cjs/AbstractModuleInstance.js.map +0 -1
- package/dist/cjs/BaseEmitter.js +0 -42
- package/dist/cjs/BaseEmitter.js.map +0 -1
- package/dist/cjs/Error.js +0 -37
- package/dist/cjs/Error.js.map +0 -1
- package/dist/cjs/QueryValidator/ModuleConfigQueryValidator.js +0 -66
- package/dist/cjs/QueryValidator/ModuleConfigQueryValidator.js.map +0 -1
- package/dist/cjs/QueryValidator/QueryValidator.js +0 -3
- package/dist/cjs/QueryValidator/QueryValidator.js.map +0 -1
- package/dist/cjs/QueryValidator/SupportedQueryValidator.js +0 -21
- package/dist/cjs/QueryValidator/SupportedQueryValidator.js.map +0 -1
- package/dist/cjs/QueryValidator/index.js +0 -7
- package/dist/cjs/QueryValidator/index.js.map +0 -1
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/index.js.map +0 -1
- package/dist/docs.json +0 -41338
- package/dist/esm/AbstractModule.js +0 -495
- package/dist/esm/AbstractModule.js.map +0 -1
- package/dist/esm/AbstractModuleInstance.js +0 -36
- package/dist/esm/AbstractModuleInstance.js.map +0 -1
- package/dist/esm/BaseEmitter.js +0 -39
- package/dist/esm/BaseEmitter.js.map +0 -1
- package/dist/esm/Error.js +0 -37
- package/dist/esm/Error.js.map +0 -1
- package/dist/esm/QueryValidator/ModuleConfigQueryValidator.js +0 -62
- package/dist/esm/QueryValidator/ModuleConfigQueryValidator.js.map +0 -1
- package/dist/esm/QueryValidator/QueryValidator.js +0 -2
- package/dist/esm/QueryValidator/QueryValidator.js.map +0 -1
- package/dist/esm/QueryValidator/SupportedQueryValidator.js +0 -16
- package/dist/esm/QueryValidator/SupportedQueryValidator.js.map +0 -1
- package/dist/esm/QueryValidator/index.js +0 -4
- package/dist/esm/QueryValidator/index.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/types/AbstractModule.d.ts.map +0 -1
- package/dist/types/AbstractModuleInstance.d.ts +0 -14
- package/dist/types/AbstractModuleInstance.d.ts.map +0 -1
- package/dist/types/BaseEmitter.d.ts +0 -17
- package/dist/types/BaseEmitter.d.ts.map +0 -1
- package/dist/types/Error.d.ts +0 -15
- package/dist/types/Error.d.ts.map +0 -1
- package/dist/types/QueryValidator/ModuleConfigQueryValidator.d.ts +0 -15
- package/dist/types/QueryValidator/ModuleConfigQueryValidator.d.ts.map +0 -1
- package/dist/types/QueryValidator/QueryValidator.d.ts +0 -8
- package/dist/types/QueryValidator/QueryValidator.d.ts.map +0 -1
- package/dist/types/QueryValidator/SupportedQueryValidator.d.ts +0 -22
- package/dist/types/QueryValidator/SupportedQueryValidator.d.ts.map +0 -1
- package/dist/types/QueryValidator/index.d.ts +0 -4
- package/dist/types/QueryValidator/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.d.ts.map +0 -1
|
@@ -1,16 +1,72 @@
|
|
|
1
|
-
import { WalletInstance } from '@xyo-network/account/packages/wallet-model';
|
|
2
1
|
import { AccountInstance } from '@xyo-network/account-model';
|
|
3
2
|
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
4
3
|
import { QueryBoundWitness } from '@xyo-network/boundwitness-builder';
|
|
4
|
+
import * as _xyo_network_boundwitness_model from '@xyo-network/boundwitness-model';
|
|
5
5
|
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
6
6
|
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
7
|
-
import {
|
|
7
|
+
import { AnyConfigSchema, ModuleConfig, SchemaString, AddressString, Module, ModuleParams, ModuleEventData, ModuleQueryBase, ModuleInstance, CreatableModule, CreatableModuleFactory, ModuleQueryResult, ModuleFilter, ModuleFilterOptions, ModuleDescriptionPayload, AddressPreviousHashPayload, ModuleQueryHandlerResult } from '@xyo-network/module-model';
|
|
8
8
|
import { CompositeModuleResolver } from '@xyo-network/module-resolver';
|
|
9
|
-
import
|
|
9
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
10
|
+
import { Payload, Query, ModuleError } from '@xyo-network/payload-model';
|
|
10
11
|
import { Promisable, PromiseEx } from '@xyo-network/promise';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import { WalletInstance } from '@xyo-network/wallet-model';
|
|
13
|
+
import { BaseParams, Base } from '@xyo-network/core';
|
|
14
|
+
import { EventData, EventFunctions, EventListener, EventAnyListener } from '@xyo-network/module-events';
|
|
15
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder';
|
|
16
|
+
|
|
17
|
+
declare class BaseEmitter<TParams extends BaseParams = BaseParams, TEventData extends EventData = EventData> extends Base<TParams> implements EventFunctions<TEventData> {
|
|
18
|
+
eventData: TEventData;
|
|
19
|
+
private events;
|
|
20
|
+
constructor(params: TParams);
|
|
21
|
+
clearListeners(eventNames: keyof TEventData | (keyof TEventData)[]): void;
|
|
22
|
+
emit<TEventName extends keyof TEventData = keyof TEventData, TEventArgs extends TEventData[TEventName] = TEventData[TEventName]>(eventName: TEventName, eventArgs: TEventArgs): Promise<void>;
|
|
23
|
+
emitSerial<TEventName extends keyof TEventData = keyof TEventData, TEventArgs extends TEventData[TEventName] = TEventData[TEventName]>(eventName: TEventName, eventArgs: TEventArgs): Promise<void>;
|
|
24
|
+
listenerCount(eventNames: keyof TEventData | (keyof TEventData)[]): number;
|
|
25
|
+
off<TEventName extends keyof TEventData>(eventNames: TEventName | TEventName[], listener: EventListener<TEventData[TEventName]>): void;
|
|
26
|
+
offAny(listener: EventAnyListener): void;
|
|
27
|
+
on<TEventName extends keyof TEventData>(eventNames: TEventName | TEventName[], listener: EventListener<TEventData[TEventName]>): () => void;
|
|
28
|
+
onAny(listener: EventAnyListener): () => void;
|
|
29
|
+
once<TEventName extends keyof TEventData>(eventName: TEventName, listener: EventListener<TEventData[TEventName]>): () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type Queryable<T extends QueryBoundWitness = QueryBoundWitness> = (query: T, payloads?: Payload[]) => Promisable<boolean>;
|
|
33
|
+
interface QueryValidator<T extends QueryBoundWitness = QueryBoundWitness> {
|
|
34
|
+
queryable: Queryable<T>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type SortedPipedAddressesString = string;
|
|
38
|
+
declare class ModuleConfigQueryValidator<TConfig extends AnyConfigSchema<ModuleConfig>> implements QueryValidator {
|
|
39
|
+
protected allowed: Record<SchemaString, SortedPipedAddressesString[]>;
|
|
40
|
+
protected disallowed: Record<SchemaString, AddressString[]>;
|
|
41
|
+
protected readonly hasAllowedRules: boolean;
|
|
42
|
+
protected readonly hasDisallowedRules: boolean;
|
|
43
|
+
protected readonly hasRules: boolean;
|
|
44
|
+
constructor(config?: TConfig);
|
|
45
|
+
queryable: Queryable;
|
|
46
|
+
protected queryAllowed: (schema: SchemaString, addresses: string[]) => boolean;
|
|
47
|
+
protected queryDisallowed: (schema: SchemaString, addresses: string[]) => boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const isQuerySupportedByModule: <T extends _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & _xyo_network_boundwitness_model.BoundWitnessFields & {
|
|
51
|
+
query: string;
|
|
52
|
+
resultSet?: string | undefined;
|
|
53
|
+
schema: "network.xyo.boundwitness";
|
|
54
|
+
} & {
|
|
55
|
+
schema: "network.xyo.boundwitness";
|
|
56
|
+
} = _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & _xyo_network_boundwitness_model.BoundWitnessFields & {
|
|
57
|
+
query: string;
|
|
58
|
+
resultSet?: string | undefined;
|
|
59
|
+
schema: "network.xyo.boundwitness";
|
|
60
|
+
} & {
|
|
61
|
+
schema: "network.xyo.boundwitness";
|
|
62
|
+
}>(mod: Module, query: T, payloads?: Payload[]) => Promise<boolean>;
|
|
63
|
+
declare class SupportedQueryValidator implements QueryValidator {
|
|
64
|
+
protected readonly mod: Module;
|
|
65
|
+
constructor(mod: Module);
|
|
66
|
+
queryable: Queryable;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare abstract class AbstractModule<TParams extends ModuleParams<AnyConfigSchema<ModuleConfig>> = ModuleParams<ModuleConfig>, TEventData extends ModuleEventData = ModuleEventData> extends BaseEmitter<TParams, TEventData> implements Module<TParams, TEventData> {
|
|
14
70
|
static configSchemas: string[];
|
|
15
71
|
static enableLazyLoad: boolean;
|
|
16
72
|
protected static privateConstructorKey: string;
|
|
@@ -34,8 +90,8 @@ export declare abstract class AbstractModule<TParams extends ModuleParams<AnyCon
|
|
|
34
90
|
get queries(): string[];
|
|
35
91
|
get queryAccountPaths(): Readonly<Record<Query['schema'], string | undefined>>;
|
|
36
92
|
get queryAccounts(): Readonly<Record<Query['schema'], AccountInstance | undefined>>;
|
|
37
|
-
protected abstract get _queryAccountPaths(): Record<Query['schema'], string>;
|
|
38
93
|
get timestamp(): boolean;
|
|
94
|
+
protected abstract get _queryAccountPaths(): Record<Query['schema'], string>;
|
|
39
95
|
static _getRootFunction(funcName: string): any;
|
|
40
96
|
static _noOverride(functionName: string): void;
|
|
41
97
|
static create<TModule extends ModuleInstance>(this: CreatableModule<TModule>, params?: Omit<TModule['params'], 'config'> & {
|
|
@@ -81,4 +137,27 @@ export declare abstract class AbstractModule<TParams extends ModuleParams<AnyCon
|
|
|
81
137
|
protected writeArchivist: () => Promise<ArchivistInstance | undefined>;
|
|
82
138
|
private getArchivist;
|
|
83
139
|
}
|
|
84
|
-
|
|
140
|
+
|
|
141
|
+
declare abstract class AbstractModuleInstance<TParams extends ModuleParams<AnyConfigSchema<ModuleConfig>> = ModuleParams<ModuleConfig>, TEventData extends ModuleEventData = ModuleEventData> extends AbstractModule<TParams, TEventData> implements Module<TParams, TEventData> {
|
|
142
|
+
constructor(privateConstructorKey: string, params: TParams, account: AccountInstance);
|
|
143
|
+
describe(): Promise<ModuleDescriptionPayload>;
|
|
144
|
+
discover(): Promise<Payload[]>;
|
|
145
|
+
manifest(ignoreAddresses?: string[]): Promise<ModuleManifestPayload>;
|
|
146
|
+
moduleAddress(): Promise<AddressPreviousHashPayload[]>;
|
|
147
|
+
subscribe(_queryAccount?: AccountInstance): void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare class ModuleErrorBuilder extends PayloadBuilder {
|
|
151
|
+
_message?: string;
|
|
152
|
+
_name?: string;
|
|
153
|
+
_query?: string;
|
|
154
|
+
_sources?: string[];
|
|
155
|
+
constructor();
|
|
156
|
+
build(): ModuleError;
|
|
157
|
+
message(message: string): this;
|
|
158
|
+
name(name: string): this;
|
|
159
|
+
query(query: string): this;
|
|
160
|
+
sources(sources: string[]): this;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { AbstractModule, AbstractModuleInstance, BaseEmitter, ModuleConfigQueryValidator, ModuleErrorBuilder, QueryValidator, Queryable, SortedPipedAddressesString, SupportedQueryValidator, isQuerySupportedByModule };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { AccountInstance } from '@xyo-network/account-model';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { QueryBoundWitness } from '@xyo-network/boundwitness-builder';
|
|
4
|
+
import * as _xyo_network_boundwitness_model from '@xyo-network/boundwitness-model';
|
|
5
|
+
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
6
|
+
import { ModuleManifestPayload } from '@xyo-network/manifest-model';
|
|
7
|
+
import { AnyConfigSchema, ModuleConfig, SchemaString, AddressString, Module, ModuleParams, ModuleEventData, ModuleQueryBase, ModuleInstance, CreatableModule, CreatableModuleFactory, ModuleQueryResult, ModuleFilter, ModuleFilterOptions, ModuleDescriptionPayload, AddressPreviousHashPayload, ModuleQueryHandlerResult } from '@xyo-network/module-model';
|
|
8
|
+
import { CompositeModuleResolver } from '@xyo-network/module-resolver';
|
|
9
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
10
|
+
import { Payload, Query, ModuleError } from '@xyo-network/payload-model';
|
|
11
|
+
import { Promisable, PromiseEx } from '@xyo-network/promise';
|
|
12
|
+
import { WalletInstance } from '@xyo-network/wallet-model';
|
|
13
|
+
import { BaseParams, Base } from '@xyo-network/core';
|
|
14
|
+
import { EventData, EventFunctions, EventListener, EventAnyListener } from '@xyo-network/module-events';
|
|
15
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder';
|
|
16
|
+
|
|
17
|
+
declare class BaseEmitter<TParams extends BaseParams = BaseParams, TEventData extends EventData = EventData> extends Base<TParams> implements EventFunctions<TEventData> {
|
|
18
|
+
eventData: TEventData;
|
|
19
|
+
private events;
|
|
20
|
+
constructor(params: TParams);
|
|
21
|
+
clearListeners(eventNames: keyof TEventData | (keyof TEventData)[]): void;
|
|
22
|
+
emit<TEventName extends keyof TEventData = keyof TEventData, TEventArgs extends TEventData[TEventName] = TEventData[TEventName]>(eventName: TEventName, eventArgs: TEventArgs): Promise<void>;
|
|
23
|
+
emitSerial<TEventName extends keyof TEventData = keyof TEventData, TEventArgs extends TEventData[TEventName] = TEventData[TEventName]>(eventName: TEventName, eventArgs: TEventArgs): Promise<void>;
|
|
24
|
+
listenerCount(eventNames: keyof TEventData | (keyof TEventData)[]): number;
|
|
25
|
+
off<TEventName extends keyof TEventData>(eventNames: TEventName | TEventName[], listener: EventListener<TEventData[TEventName]>): void;
|
|
26
|
+
offAny(listener: EventAnyListener): void;
|
|
27
|
+
on<TEventName extends keyof TEventData>(eventNames: TEventName | TEventName[], listener: EventListener<TEventData[TEventName]>): () => void;
|
|
28
|
+
onAny(listener: EventAnyListener): () => void;
|
|
29
|
+
once<TEventName extends keyof TEventData>(eventName: TEventName, listener: EventListener<TEventData[TEventName]>): () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type Queryable<T extends QueryBoundWitness = QueryBoundWitness> = (query: T, payloads?: Payload[]) => Promisable<boolean>;
|
|
33
|
+
interface QueryValidator<T extends QueryBoundWitness = QueryBoundWitness> {
|
|
34
|
+
queryable: Queryable<T>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type SortedPipedAddressesString = string;
|
|
38
|
+
declare class ModuleConfigQueryValidator<TConfig extends AnyConfigSchema<ModuleConfig>> implements QueryValidator {
|
|
39
|
+
protected allowed: Record<SchemaString, SortedPipedAddressesString[]>;
|
|
40
|
+
protected disallowed: Record<SchemaString, AddressString[]>;
|
|
41
|
+
protected readonly hasAllowedRules: boolean;
|
|
42
|
+
protected readonly hasDisallowedRules: boolean;
|
|
43
|
+
protected readonly hasRules: boolean;
|
|
44
|
+
constructor(config?: TConfig);
|
|
45
|
+
queryable: Queryable;
|
|
46
|
+
protected queryAllowed: (schema: SchemaString, addresses: string[]) => boolean;
|
|
47
|
+
protected queryDisallowed: (schema: SchemaString, addresses: string[]) => boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const isQuerySupportedByModule: <T extends _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & _xyo_network_boundwitness_model.BoundWitnessFields & {
|
|
51
|
+
query: string;
|
|
52
|
+
resultSet?: string | undefined;
|
|
53
|
+
schema: "network.xyo.boundwitness";
|
|
54
|
+
} & {
|
|
55
|
+
schema: "network.xyo.boundwitness";
|
|
56
|
+
} = _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & _xyo_network_boundwitness_model.BoundWitnessFields & {
|
|
57
|
+
query: string;
|
|
58
|
+
resultSet?: string | undefined;
|
|
59
|
+
schema: "network.xyo.boundwitness";
|
|
60
|
+
} & {
|
|
61
|
+
schema: "network.xyo.boundwitness";
|
|
62
|
+
}>(mod: Module, query: T, payloads?: Payload[]) => Promise<boolean>;
|
|
63
|
+
declare class SupportedQueryValidator implements QueryValidator {
|
|
64
|
+
protected readonly mod: Module;
|
|
65
|
+
constructor(mod: Module);
|
|
66
|
+
queryable: Queryable;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare abstract class AbstractModule<TParams extends ModuleParams<AnyConfigSchema<ModuleConfig>> = ModuleParams<ModuleConfig>, TEventData extends ModuleEventData = ModuleEventData> extends BaseEmitter<TParams, TEventData> implements Module<TParams, TEventData> {
|
|
70
|
+
static configSchemas: string[];
|
|
71
|
+
static enableLazyLoad: boolean;
|
|
72
|
+
protected static privateConstructorKey: string;
|
|
73
|
+
readonly downResolver: Omit<CompositeModuleResolver, 'resolve'>;
|
|
74
|
+
readonly upResolver: Omit<CompositeModuleResolver, 'resolve>'>;
|
|
75
|
+
protected _account: AccountInstance | undefined;
|
|
76
|
+
protected readonly _baseModuleQueryAccountPaths: Record<ModuleQueryBase['schema'], string>;
|
|
77
|
+
protected readonly _queryAccounts: Record<ModuleQueryBase['schema'], AccountInstance | undefined>;
|
|
78
|
+
protected _startPromise: Promisable<boolean> | undefined;
|
|
79
|
+
protected _started: Promisable<boolean> | undefined;
|
|
80
|
+
protected readonly moduleConfigQueryValidator: Queryable;
|
|
81
|
+
protected readonly supportedQueryValidator: Queryable;
|
|
82
|
+
private _busyCount;
|
|
83
|
+
constructor(privateConstructorKey: string, params: TParams, account: AccountInstance);
|
|
84
|
+
static get configSchema(): string;
|
|
85
|
+
get account(): AccountInstance;
|
|
86
|
+
get address(): string;
|
|
87
|
+
get allowAnonymous(): boolean;
|
|
88
|
+
get config(): TParams['config'];
|
|
89
|
+
get ephemeralQueryAccountEnabled(): boolean;
|
|
90
|
+
get queries(): string[];
|
|
91
|
+
get queryAccountPaths(): Readonly<Record<Query['schema'], string | undefined>>;
|
|
92
|
+
get queryAccounts(): Readonly<Record<Query['schema'], AccountInstance | undefined>>;
|
|
93
|
+
get timestamp(): boolean;
|
|
94
|
+
protected abstract get _queryAccountPaths(): Record<Query['schema'], string>;
|
|
95
|
+
static _getRootFunction(funcName: string): any;
|
|
96
|
+
static _noOverride(functionName: string): void;
|
|
97
|
+
static create<TModule extends ModuleInstance>(this: CreatableModule<TModule>, params?: Omit<TModule['params'], 'config'> & {
|
|
98
|
+
config?: TModule['params']['config'];
|
|
99
|
+
}): Promise<TModule>;
|
|
100
|
+
static determineAccount({ account, accountDerivationPath, wallet, }: {
|
|
101
|
+
account?: AccountInstance | 'random';
|
|
102
|
+
accountDerivationPath?: string;
|
|
103
|
+
wallet?: WalletInstance;
|
|
104
|
+
}): Promise<AccountInstance>;
|
|
105
|
+
static factory<TModule extends ModuleInstance>(this: CreatableModule<TModule>, params?: Omit<TModule['params'], 'config'> & {
|
|
106
|
+
config?: TModule['params']['config'];
|
|
107
|
+
}): CreatableModuleFactory<TModule>;
|
|
108
|
+
_getRootFunction(funcName: string): any;
|
|
109
|
+
_noOverride(functionName: string): void;
|
|
110
|
+
busy<R>(closure: () => Promise<R>): Promise<R>;
|
|
111
|
+
emit<TEventName extends keyof TEventData = keyof TEventData, TEventArgs extends TEventData[TEventName] = TEventData[TEventName]>(eventName: TEventName, eventArgs: TEventArgs): Promise<void>;
|
|
112
|
+
previousHash(): Promisable<string | undefined>;
|
|
113
|
+
query<T extends QueryBoundWitness = QueryBoundWitness, TConfig extends ModuleConfig = ModuleConfig>(query: T, payloads?: Payload[], queryConfig?: TConfig): Promise<ModuleQueryResult>;
|
|
114
|
+
queryable<T extends QueryBoundWitness = QueryBoundWitness, TConfig extends ModuleConfig = ModuleConfig>(query: T, payloads?: Payload[], queryConfig?: TConfig): boolean;
|
|
115
|
+
resolve<T extends ModuleInstance = ModuleInstance>(filter?: ModuleFilter, options?: ModuleFilterOptions<T>): Promise<T[]>;
|
|
116
|
+
resolve<T extends ModuleInstance = ModuleInstance>(nameOrAddress: string, options?: ModuleFilterOptions<T>): Promise<T | undefined>;
|
|
117
|
+
start(_timeout?: number): Promisable<boolean>;
|
|
118
|
+
started(notStartedAction?: 'error' | 'throw' | 'warn' | 'log' | 'none', tryStart?: boolean): Promise<boolean>;
|
|
119
|
+
stop(_timeout?: number): Promise<boolean>;
|
|
120
|
+
protected bindHashes(hashes: string[], schema: SchemaString[], account?: AccountInstance): PromiseEx<unknown, AccountInstance>;
|
|
121
|
+
protected bindHashesInternal(hashes: string[], schema: SchemaString[], account?: AccountInstance): Promise<BoundWitness>;
|
|
122
|
+
protected bindQuery<T extends Query>(query: T, payloads?: Payload[], account?: AccountInstance): PromiseEx<[QueryBoundWitness, Payload[], Payload[]], AccountInstance>;
|
|
123
|
+
protected bindQueryInternal<T extends Query>(query: T, payloads?: Payload[], account?: AccountInstance): Promise<[QueryBoundWitness, Payload[], Payload[]]>;
|
|
124
|
+
protected bindQueryResult<T extends Query>(query: T, payloads: Payload[], additionalWitnesses?: AccountInstance[], errors?: ModuleError[]): Promise<ModuleQueryResult>;
|
|
125
|
+
protected commitArchivist: () => Promise<ArchivistInstance | undefined>;
|
|
126
|
+
protected describeHandler(): Promise<ModuleDescriptionPayload>;
|
|
127
|
+
protected discoverHandler(): Promisable<Payload[]>;
|
|
128
|
+
protected initializeQueryAccounts(): Promise<void>;
|
|
129
|
+
protected manifestHandler(_ignoreAddresses?: string[]): Promisable<ModuleManifestPayload>;
|
|
130
|
+
protected moduleAddressHandler(): Promisable<AddressPreviousHashPayload[]>;
|
|
131
|
+
protected queryHandler<T extends QueryBoundWitness = QueryBoundWitness, TConfig extends ModuleConfig = ModuleConfig>(query: T, payloads?: Payload[], queryConfig?: TConfig): Promise<ModuleQueryHandlerResult>;
|
|
132
|
+
protected readArchivist: () => Promise<ArchivistInstance | undefined>;
|
|
133
|
+
protected startHandler(): Promise<boolean>;
|
|
134
|
+
protected stopHandler(_timeout?: number): Promisable<boolean>;
|
|
135
|
+
protected subscribeHandler(): void;
|
|
136
|
+
protected validateConfig(config?: unknown, parents?: string[]): boolean;
|
|
137
|
+
protected writeArchivist: () => Promise<ArchivistInstance | undefined>;
|
|
138
|
+
private getArchivist;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare abstract class AbstractModuleInstance<TParams extends ModuleParams<AnyConfigSchema<ModuleConfig>> = ModuleParams<ModuleConfig>, TEventData extends ModuleEventData = ModuleEventData> extends AbstractModule<TParams, TEventData> implements Module<TParams, TEventData> {
|
|
142
|
+
constructor(privateConstructorKey: string, params: TParams, account: AccountInstance);
|
|
143
|
+
describe(): Promise<ModuleDescriptionPayload>;
|
|
144
|
+
discover(): Promise<Payload[]>;
|
|
145
|
+
manifest(ignoreAddresses?: string[]): Promise<ModuleManifestPayload>;
|
|
146
|
+
moduleAddress(): Promise<AddressPreviousHashPayload[]>;
|
|
147
|
+
subscribe(_queryAccount?: AccountInstance): void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare class ModuleErrorBuilder extends PayloadBuilder {
|
|
151
|
+
_message?: string;
|
|
152
|
+
_name?: string;
|
|
153
|
+
_query?: string;
|
|
154
|
+
_sources?: string[];
|
|
155
|
+
constructor();
|
|
156
|
+
build(): ModuleError;
|
|
157
|
+
message(message: string): this;
|
|
158
|
+
name(name: string): this;
|
|
159
|
+
query(query: string): this;
|
|
160
|
+
sources(sources: string[]): this;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { AbstractModule, AbstractModuleInstance, BaseEmitter, ModuleConfigQueryValidator, ModuleErrorBuilder, QueryValidator, Queryable, SortedPipedAddressesString, SupportedQueryValidator, isQuerySupportedByModule };
|