-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add types, bump to 2.0.3 [fixes #29]
- Loading branch information
1 parent
9a020ac
commit 7abcc0d
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"name": "slack-notify", | ||
"description": "A simple Node.js wrapper around the Slack webhook API.", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"repository": "https://github.com/andrewchilds/slack-notify.git", | ||
"homepage": "https://github.com/andrewchilds/slack-notify", | ||
"main": "./src/esm/index.mjs", | ||
"types": "./src/index.d.ts", | ||
"author": { | ||
"name": "Andrew Childs", | ||
"email": "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
declare module 'slack-notify' { | ||
interface SlackNofifier { | ||
send(args: string | SendArgs): Promise<void>; | ||
} | ||
|
||
interface SlackNotify extends SlackNofifier { | ||
extend(args: string | SendArgs): SlackNofifier; | ||
success(args: string | SendArgs): SlackNofifier; | ||
bug(args: string | SendArgs): SlackNofifier; | ||
alert(args: string | SendArgs): SlackNofifier; | ||
} | ||
|
||
interface SendArgs { | ||
text: string; | ||
channel?: string; | ||
icno_url?: string; | ||
icon_emoji?: string; | ||
unfurl_links?: number; | ||
username?: string; | ||
attachments?: SendAttachment[]; | ||
fields?: { [key: string]: string }[]; | ||
} | ||
|
||
interface SendAttachment { | ||
fallback: string; | ||
fields?: SendAttachmentField[]; | ||
} | ||
|
||
interface SendAttachmentField { | ||
title: string; | ||
value: string; | ||
short: boolean; | ||
} | ||
|
||
function SlackNotifyFactory(webhookUrl: string): SlackNotify; | ||
|
||
export default SlackNotifyFactory; | ||
} |