From c41de6474e09580303f6809bbe7dd829f6b616d6 Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 23 Nov 2024 15:20:28 +0200 Subject: [PATCH] Typing fixes * More complete embed types --- package.json | 9 ++++++--- src/types/Webhook.ts | 27 +++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f8812e3..aa7b8e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@navy.gif/discord-webhook", - "version": "1.2.5", + "version": "1.2.6", "description": "Client for interacting with discord webhooks", "author": "Navy.gif", "license": "MIT", @@ -17,12 +17,15 @@ } }, "files": [ - "build/**/*" + "build/**/*", + "README.md" ], "scripts": { "build": "tsc --build --force && tsc --project tsconfig.cjs.json && node ./scripts/declareTypes.js", "test": "tsc && jest", - "release": "yarn build && yarn publish", + "release:patch": "yarn build && yarn version patch && yarn npm publish", + "release:minor": "yarn build && yarn version minor && yarn npm publish", + "release:major": "yarn build && yarn version major && yarn npm publish", "lint": "eslint --fix" }, "devDependencies": { diff --git a/src/types/Webhook.ts b/src/types/Webhook.ts index 85afbf8..4579be9 100644 --- a/src/types/Webhook.ts +++ b/src/types/Webhook.ts @@ -21,6 +21,25 @@ type WebhookData = { url: string } +type EmbedFooter = { + text: string, + icon_url?: string, + proxy_icon_url?: string +} + +type EmbedField = { + name: string, + value: string, + inline?: boolean +} + +type EmbedAuthor = { + name: string, + url?: string, + icon_url?: string, + proxy_icon_url?: string, +} + type Embed = { title?: string, type?: string, @@ -28,9 +47,9 @@ type Embed = { url?: string, timestamp?: string, color?: number, - // TODO: Finish types - // footer?: EmbedFooter, - + footer?: EmbedFooter, + fields?: EmbedField[] + author?: EmbedAuthor, } type File = { @@ -53,4 +72,4 @@ type Payload = { } } -export { WebhookData, WebhookClientOptions, WebhookType, Payload }; \ No newline at end of file +export { WebhookData, WebhookClientOptions, WebhookType, Payload, Embed, EmbedFooter, EmbedField, EmbedAuthor }; \ No newline at end of file