From e1a56f9270df83a834c8e37c0de8cc7f939021c9 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 13 Apr 2022 02:04:51 -0400 Subject: [PATCH] typos --- dist/bitburner.d.ts | 9 ++++++--- markdown/bitburner.md | 1 + markdown/bitburner.ns.enums.md | 11 +++++++++++ markdown/bitburner.ns.md | 1 + markdown/bitburner.ns.toast.md | 4 ++-- markdown/bitburner.nsenums.md | 2 +- markdown/bitburner.nsenums.toast.md | 2 +- markdown/bitburner.toastvariantvalues.md | 14 ++++++++++++++ src/NetscriptFunctions.ts | 2 +- src/ScriptEditor/NetscriptDefinitions.d.ts | 3 ++- 10 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 markdown/bitburner.ns.enums.md create mode 100644 markdown/bitburner.toastvariantvalues.md diff --git a/dist/bitburner.d.ts b/dist/bitburner.d.ts index defda2c10..57d578d6a 100644 --- a/dist/bitburner.d.ts +++ b/dist/bitburner.d.ts @@ -4503,7 +4503,7 @@ export declare interface NS { * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success. * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000 */ - toast(msg: any, variant?: "success" | "info" | "warning" | "error", duration?: number | null): void; + toast(msg: any, variant?: ToastVariantValues, duration?: number | null): void; /** * Download a file from the internet. @@ -4699,12 +4699,12 @@ export declare interface NS { */ getSharePower(): number; - // enum: NSEnums; + enums: NSEnums; } /** @public */ export declare interface NSEnums { - toast: ToastVariant; + toast: typeof ToastVariant; } /** @@ -6839,6 +6839,9 @@ export declare enum ToastVariant { INFO = "info", } +/** @public */ +export declare type ToastVariantValues = `${ToastVariant}`; + /** * User Interface API. * @public diff --git a/markdown/bitburner.md b/markdown/bitburner.md index 48bc56bbe..6a923b9a4 100644 --- a/markdown/bitburner.md +++ b/markdown/bitburner.md @@ -92,4 +92,5 @@ | Type Alias | Description | | --- | --- | | [FilenameOrPID](./bitburner.filenameorpid.md) | | +| [ToastVariantValues](./bitburner.toastvariantvalues.md) | | diff --git a/markdown/bitburner.ns.enums.md b/markdown/bitburner.ns.enums.md new file mode 100644 index 000000000..8e1654518 --- /dev/null +++ b/markdown/bitburner.ns.enums.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [enums](./bitburner.ns.enums.md) + +## NS.enums property + +Signature: + +```typescript +enums: NSEnums; +``` diff --git a/markdown/bitburner.ns.md b/markdown/bitburner.ns.md index 439ba8532..9da71003f 100644 --- a/markdown/bitburner.ns.md +++ b/markdown/bitburner.ns.md @@ -44,6 +44,7 @@ export async function main(ns) { | [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. | | [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. | | [corporation](./bitburner.ns.corporation.md) | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. RAM cost: 0 GB | +| [enums](./bitburner.ns.enums.md) | [NSEnums](./bitburner.nsenums.md) | | | [formulas](./bitburner.ns.formulas.md) | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. | | [gang](./bitburner.ns.gang.md) | [Gang](./bitburner.gang.md) | Namespace for gang functions. | | [grafting](./bitburner.ns.grafting.md) | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. | diff --git a/markdown/bitburner.ns.toast.md b/markdown/bitburner.ns.toast.md index 908131eef..6770c4933 100644 --- a/markdown/bitburner.ns.toast.md +++ b/markdown/bitburner.ns.toast.md @@ -9,7 +9,7 @@ Queue a toast (bottom-right notification). Signature: ```typescript -toast(msg: any, variant?: "success" | "info" | "warning" | "error", duration?: number | null): void; +toast(msg: any, variant?: ToastVariantValues, duration?: number | null): void; ``` ## Parameters @@ -17,7 +17,7 @@ toast(msg: any, variant?: "success" | "info" | "warning" | "error", duration?: n | Parameter | Type | Description | | --- | --- | --- | | msg | any | Message in the toast. | -| variant | "success" \| "info" \| "warning" \| "error" | Type of toast, must be one of success, info, warning, error. Defaults to success. | +| variant | [ToastVariantValues](./bitburner.toastvariantvalues.md) | Type of toast, must be one of success, info, warning, error. Defaults to success. | | duration | number \| null | Duration of toast in ms. Can also be null to create a persistent toast. Defaults to 2000 | Returns: diff --git a/markdown/bitburner.nsenums.md b/markdown/bitburner.nsenums.md index eb534afd9..241d87407 100644 --- a/markdown/bitburner.nsenums.md +++ b/markdown/bitburner.nsenums.md @@ -15,5 +15,5 @@ export interface NSEnums | Property | Type | Description | | --- | --- | --- | -| [toast](./bitburner.nsenums.toast.md) | [ToastVariant](./bitburner.toastvariant.md) | | +| [toast](./bitburner.nsenums.toast.md) | typeof [ToastVariant](./bitburner.toastvariant.md) | | diff --git a/markdown/bitburner.nsenums.toast.md b/markdown/bitburner.nsenums.toast.md index 015ce95c9..525a79649 100644 --- a/markdown/bitburner.nsenums.toast.md +++ b/markdown/bitburner.nsenums.toast.md @@ -7,5 +7,5 @@ Signature: ```typescript -toast: ToastVariant; +toast: typeof ToastVariant; ``` diff --git a/markdown/bitburner.toastvariantvalues.md b/markdown/bitburner.toastvariantvalues.md new file mode 100644 index 000000000..84f640c50 --- /dev/null +++ b/markdown/bitburner.toastvariantvalues.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [ToastVariantValues](./bitburner.toastvariantvalues.md) + +## ToastVariantValues type + + +Signature: + +```typescript +export type ToastVariantValues = `${ToastVariant}`; +``` +References: [ToastVariant](./bitburner.toastvariant.md) + diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 05bcc8b00..5134fd41d 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -2555,7 +2555,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { } }, flags: Flags(workerScript.args), - enum: { + enums: { toast: ToastVariant, }, }; diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 41c5e5b24..569bb8478 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -6423,7 +6423,7 @@ export interface NS { */ getSharePower(): number; - enum: NSEnums; + enums: NSEnums; } /** @public */ @@ -6434,6 +6434,7 @@ export enum ToastVariant { INFO = "info", } +/** @public */ export type ToastVariantValues = `${ToastVariant}`; /** @public */