From 437b8759cbb84666a2ed000f6c6d74e01cfcc1f5 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Tue, 17 Jan 2023 11:33:48 -0600 Subject: [PATCH] docs: add new plugins docs --- docs/api/enums/SernError.md | 104 ++++++++++++++++ docs/api/interfaces/ControlPlugin.md | 47 +++++++ .../api/interfaces/DependencyConfiguration.md | 47 +++++++ docs/api/interfaces/DiscordEventCommand.md | 113 +++++++++++++++++ docs/api/interfaces/ExternalEventCommand.md | 117 ++++++++++++++++++ docs/api/interfaces/InitArgs.md | 33 +++++ docs/api/interfaces/InitPlugin.md | 47 +++++++ docs/api/interfaces/SernEventCommand.md | 113 +++++++++++++++++ 8 files changed, 621 insertions(+) create mode 100644 docs/api/enums/SernError.md create mode 100644 docs/api/interfaces/ControlPlugin.md create mode 100644 docs/api/interfaces/DependencyConfiguration.md create mode 100644 docs/api/interfaces/DiscordEventCommand.md create mode 100644 docs/api/interfaces/ExternalEventCommand.md create mode 100644 docs/api/interfaces/InitArgs.md create mode 100644 docs/api/interfaces/InitPlugin.md create mode 100644 docs/api/interfaces/SernEventCommand.md diff --git a/docs/api/enums/SernError.md b/docs/api/enums/SernError.md new file mode 100644 index 0000000..ad7b0af --- /dev/null +++ b/docs/api/enums/SernError.md @@ -0,0 +1,104 @@ +--- +id: "SernError" +title: "Enumeration: SernError" +sidebar_label: "SernError" +sidebar_position: 0 +custom_edit_url: null +--- + +## Enumeration Members + +### InvalidModuleType + +• **InvalidModuleType** = ``"Detected an unknown module type"`` + +Throws when registering an invalid module. +This means it is undefined or an invalid command type was provided + +#### Defined in + +[src/handler/structures/errors.ts:9](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L9) + +___ + +### MismatchEvent + +• **MismatchEvent** = ``"You cannot use message when an interaction fired or vice versa"`` + +A crash that occurs when accessing an invalid property of Context + +#### Defined in + +[src/handler/structures/errors.ts:29](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L29) + +___ + +### MismatchModule + +• **MismatchModule** = ``"A module type mismatched with event emitted!"`` + +Attempted to lookup module in command module store. Nothing was found! + +#### Defined in + +[src/handler/structures/errors.ts:17](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L17) + +___ + +### MissingRequired + +• **MissingRequired** = ``"@sern/client is required but was not found"`` + +Required Dependency not found + +#### Defined in + +[src/handler/structures/errors.ts:37](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L37) + +___ + +### NotSupportedInteraction + +• **NotSupportedInteraction** = ``"This interaction is not supported."`` + +Unsupported interaction at this moment. + +#### Defined in + +[src/handler/structures/errors.ts:21](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L21) + +___ + +### NotSupportedYet + +• **NotSupportedYet** = ``"This feature is not supported yet"`` + +Unsupported feature attempted to access at this time + +#### Defined in + +[src/handler/structures/errors.ts:33](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L33) + +___ + +### PluginFailure + +• **PluginFailure** = ``"A plugin failed to call controller.next()"`` + +One plugin called `controller.stop()` (end command execution / loading) + +#### Defined in + +[src/handler/structures/errors.ts:25](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L25) + +___ + +### UndefinedModule + +• **UndefinedModule** = ``"A module could not be detected"`` + +Attempted to lookup module in command module store. Nothing was found! + +#### Defined in + +[src/handler/structures/errors.ts:13](https://github.com/sern-handler/handler/blob/b641472/src/handler/structures/errors.ts#L13) diff --git a/docs/api/interfaces/ControlPlugin.md b/docs/api/interfaces/ControlPlugin.md new file mode 100644 index 0000000..5556c03 --- /dev/null +++ b/docs/api/interfaces/ControlPlugin.md @@ -0,0 +1,47 @@ +--- +id: "ControlPlugin" +title: "Interface: ControlPlugin" +sidebar_label: "ControlPlugin" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Args` | extends `any`[] = `any`[] | + +## Properties + +### execute + +• **execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult) + +#### Type declaration + +▸ (...`args`): [`PluginResult`](../modules.md#pluginresult) + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `Args` | + +##### Returns + +[`PluginResult`](../modules.md#pluginresult) + +#### Defined in + +[src/types/plugin.ts:39](https://github.com/sern-handler/handler/blob/b641472/src/types/plugin.ts#L39) + +___ + +### type + +• **type**: [`Event`](../enums/PluginType.md#event) + +#### Defined in + +[src/types/plugin.ts:38](https://github.com/sern-handler/handler/blob/b641472/src/types/plugin.ts#L38) diff --git a/docs/api/interfaces/DependencyConfiguration.md b/docs/api/interfaces/DependencyConfiguration.md new file mode 100644 index 0000000..d46943e --- /dev/null +++ b/docs/api/interfaces/DependencyConfiguration.md @@ -0,0 +1,47 @@ +--- +id: "DependencyConfiguration" +title: "Interface: DependencyConfiguration" +sidebar_label: "DependencyConfiguration" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`Dependencies`](Dependencies.md) | + +## Properties + +### build + +• **build**: (`root`: `Container`<`Omit`<[`Dependencies`](Dependencies.md), ``"@sern/client"``\>, {}\>) => `Container`<`T`, {}\> + +#### Type declaration + +▸ (`root`): `Container`<`T`, {}\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `root` | `Container`<`Omit`<[`Dependencies`](Dependencies.md), ``"@sern/client"``\>, {}\> | + +##### Returns + +`Container`<`T`, {}\> + +#### Defined in + +[src/types/handler.ts:68](https://github.com/sern-handler/handler/blob/b641472/src/types/handler.ts#L68) + +___ + +### exclude + +• `Optional` **exclude**: `Set`<``"@sern/logger"``\> + +#### Defined in + +[src/types/handler.ts:67](https://github.com/sern-handler/handler/blob/b641472/src/types/handler.ts#L67) diff --git a/docs/api/interfaces/DiscordEventCommand.md b/docs/api/interfaces/DiscordEventCommand.md new file mode 100644 index 0000000..f9be758 --- /dev/null +++ b/docs/api/interfaces/DiscordEventCommand.md @@ -0,0 +1,113 @@ +--- +id: "DiscordEventCommand" +title: "Interface: DiscordEventCommand" +sidebar_label: "DiscordEventCommand" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends keyof `ClientEvents` = keyof `ClientEvents` | + +## Hierarchy + +- [`Module`](Module.md) + + ↳ **`DiscordEventCommand`** + +## Properties + +### description + +• `Optional` **description**: `string` + +#### Inherited from + +[Module](Module.md).[description](Module.md#description) + +#### Defined in + +[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L38) + +___ + +### name + +• `Optional` **name**: `T` + +#### Overrides + +[Module](Module.md).[name](Module.md#name) + +#### Defined in + +[src/types/module.ts:123](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L123) + +___ + +### onEvent + +• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[onEvent](Module.md#onevent) + +#### Defined in + +[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L36) + +___ + +### plugins + +• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[plugins](Module.md#plugins) + +#### Defined in + +[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L37) + +___ + +### type + +• **type**: [`Discord`](../enums/EventType.md#discord) + +#### Overrides + +[Module](Module.md).[type](Module.md#type) + +#### Defined in + +[src/types/module.ts:124](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L124) + +## Methods + +### execute + +▸ **execute**(...`args`): `unknown` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `ClientEvents`[`T`] | + +#### Returns + +`unknown` + +#### Overrides + +Module.execute + +#### Defined in + +[src/types/module.ts:125](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L125) diff --git a/docs/api/interfaces/ExternalEventCommand.md b/docs/api/interfaces/ExternalEventCommand.md new file mode 100644 index 0000000..0bd8708 --- /dev/null +++ b/docs/api/interfaces/ExternalEventCommand.md @@ -0,0 +1,117 @@ +--- +id: "ExternalEventCommand" +title: "Interface: ExternalEventCommand" +sidebar_label: "ExternalEventCommand" +sidebar_position: 0 +custom_edit_url: null +--- + +## Hierarchy + +- [`Module`](Module.md) + + ↳ **`ExternalEventCommand`** + +## Properties + +### description + +• `Optional` **description**: `string` + +#### Inherited from + +[Module](Module.md).[description](Module.md#description) + +#### Defined in + +[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L38) + +___ + +### emitter + +• **emitter**: `string` + +#### Defined in + +[src/types/module.ts:130](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L130) + +___ + +### name + +• `Optional` **name**: `string` + +#### Overrides + +[Module](Module.md).[name](Module.md#name) + +#### Defined in + +[src/types/module.ts:129](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L129) + +___ + +### onEvent + +• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[onEvent](Module.md#onevent) + +#### Defined in + +[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L36) + +___ + +### plugins + +• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[plugins](Module.md#plugins) + +#### Defined in + +[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L37) + +___ + +### type + +• **type**: [`External`](../enums/EventType.md#external) + +#### Overrides + +[Module](Module.md).[type](Module.md#type) + +#### Defined in + +[src/types/module.ts:131](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L131) + +## Methods + +### execute + +▸ **execute**(...`args`): `unknown` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `unknown`[] | + +#### Returns + +`unknown` + +#### Overrides + +Module.execute + +#### Defined in + +[src/types/module.ts:132](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L132) diff --git a/docs/api/interfaces/InitArgs.md b/docs/api/interfaces/InitArgs.md new file mode 100644 index 0000000..89bf05f --- /dev/null +++ b/docs/api/interfaces/InitArgs.md @@ -0,0 +1,33 @@ +--- +id: "InitArgs" +title: "Interface: InitArgs" +sidebar_label: "InitArgs" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`Processed`](../modules.md#processed)<[`Module`](Module.md)\> | + +## Properties + +### absPath + +• **absPath**: `string` + +#### Defined in + +[src/handler/plugins/args.ts:106](https://github.com/sern-handler/handler/blob/b641472/src/handler/plugins/args.ts#L106) + +___ + +### module + +• **module**: `T` + +#### Defined in + +[src/handler/plugins/args.ts:105](https://github.com/sern-handler/handler/blob/b641472/src/handler/plugins/args.ts#L105) diff --git a/docs/api/interfaces/InitPlugin.md b/docs/api/interfaces/InitPlugin.md new file mode 100644 index 0000000..49e1999 --- /dev/null +++ b/docs/api/interfaces/InitPlugin.md @@ -0,0 +1,47 @@ +--- +id: "InitPlugin" +title: "Interface: InitPlugin" +sidebar_label: "InitPlugin" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Args` | extends `any`[] = `any`[] | + +## Properties + +### execute + +• **execute**: (...`args`: `Args`) => [`PluginResult`](../modules.md#pluginresult) + +#### Type declaration + +▸ (...`args`): [`PluginResult`](../modules.md#pluginresult) + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `Args` | + +##### Returns + +[`PluginResult`](../modules.md#pluginresult) + +#### Defined in + +[src/types/plugin.ts:35](https://github.com/sern-handler/handler/blob/b641472/src/types/plugin.ts#L35) + +___ + +### type + +• **type**: [`Init`](../enums/PluginType.md#init) + +#### Defined in + +[src/types/plugin.ts:34](https://github.com/sern-handler/handler/blob/b641472/src/types/plugin.ts#L34) diff --git a/docs/api/interfaces/SernEventCommand.md b/docs/api/interfaces/SernEventCommand.md new file mode 100644 index 0000000..94002df --- /dev/null +++ b/docs/api/interfaces/SernEventCommand.md @@ -0,0 +1,113 @@ +--- +id: "SernEventCommand" +title: "Interface: SernEventCommand" +sidebar_label: "SernEventCommand" +sidebar_position: 0 +custom_edit_url: null +--- + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends keyof [`SernEventsMapping`](../modules.md#serneventsmapping) = keyof [`SernEventsMapping`](../modules.md#serneventsmapping) | + +## Hierarchy + +- [`Module`](Module.md) + + ↳ **`SernEventCommand`** + +## Properties + +### description + +• `Optional` **description**: `string` + +#### Inherited from + +[Module](Module.md).[description](Module.md#description) + +#### Defined in + +[src/types/module.ts:38](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L38) + +___ + +### name + +• `Optional` **name**: `T` + +#### Overrides + +[Module](Module.md).[name](Module.md#name) + +#### Defined in + +[src/types/module.ts:116](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L116) + +___ + +### onEvent + +• **onEvent**: [`ControlPlugin`](ControlPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[onEvent](Module.md#onevent) + +#### Defined in + +[src/types/module.ts:36](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L36) + +___ + +### plugins + +• **plugins**: [`InitPlugin`](InitPlugin.md)<`any`[]\>[] + +#### Inherited from + +[Module](Module.md).[plugins](Module.md#plugins) + +#### Defined in + +[src/types/module.ts:37](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L37) + +___ + +### type + +• **type**: [`Sern`](../enums/EventType.md#sern) + +#### Overrides + +[Module](Module.md).[type](Module.md#type) + +#### Defined in + +[src/types/module.ts:117](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L117) + +## Methods + +### execute + +▸ **execute**(...`args`): `unknown` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | [`SernEventsMapping`](../modules.md#serneventsmapping)[`T`] | + +#### Returns + +`unknown` + +#### Overrides + +Module.execute + +#### Defined in + +[src/types/module.ts:118](https://github.com/sern-handler/handler/blob/b641472/src/types/module.ts#L118)