@types/node-slack
TypeScript icon, indicating that this package has built-in type declarations

0.0.34 • Public • Published

Installation

npm install --save @types/node-slack

Summary

This package contains type definitions for node-slack (https://github.com/xoxco/node-slack).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-slack.

index.d.ts

import request = require("request");

declare class Slack {
    constructor(hookUrl: string, option?: Slack.Option);
    send(message: Slack.Message): any; // TODO: Here comes deferred's promise as a return type
    send(message: Slack.Message, callback: Slack.SendCallback): request.Request;
    respond(query: Slack.Query): Slack.TextResponse;
    respond(query: Slack.Query, callback: Slack.ResponseCallback): Slack.TextResponse;
}

declare namespace Slack {
    interface Option {
        proxy: string;
    }

    interface Message {
        text: string;
        channel?: string | undefined;
        username?: string | undefined;
        icon_emoji?: string | undefined;
        attachments?: any[] | undefined;
        unfurl_links?: boolean | undefined;
        link_names?: number | undefined;
    }

    interface SendCallback {
        (err: any, body: any): any;
    }

    interface Query {
        token?: string | undefined;
        team_id?: string | undefined;
        channel_id?: string | undefined;
        channel_name?: string | undefined;
        timestamp?: number | undefined;
        user_id?: string | undefined;
        user_name?: string | undefined;
        text: string;
    }

    interface TextResponse {
        text: string;
    }

    interface ResponseCallback {
        (err: any, query: Query): any;
    }
}

export = Slack;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/request

Credits

These definitions were written by Qubo.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-slack

Weekly Downloads

678

Version

0.0.34

License

MIT

Unpacked Size

5.34 kB

Total Files

5

Last publish

Collaborators

  • types