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

0.6.2 • Public • Published

Installation

npm install --save @types/africastalking

Summary

This package contains type definitions for africastalking (https://www.npmjs.com/package/africastalking).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/africastalking.

index.d.ts

interface SMSMessageData {
    Message: string;
    Recipients: {
        "statusCode": number;
        "number": string;
        "status": "fulfilled" | "failed";
        "cost": string;
        "messageId": string;
    };
}

interface SMSOptions {
    to: string | string[];
    from: string;
    message: string;
}

interface SMS {
    /**
     * This is used to send SMSs to your clients/recipients.
     *
     * @param to The recipients' phone number.  e.g +2547********. Note it can either be a string or an array
     * @param from Your registered short code or alphanumeric, e.g. AFRICASTKNG.
     * @param message The message to be sent.
     */
    send: (options: SMSOptions) => Promise<SMSMessageData>;
    /**
     * This is used to send SMSs to your clients/recipients.
     *
     * @param to The recipients' phone number.  e.g +2547********. Note it can either be a string or an array
     * @param from Your registered short code or alphanumeric, e.g. AFRICASTKNG.
     * @param message The message to be sent.
     */
    sendBulk: (options: SMSOptions) => Promise<SMSMessageData>;
    createSubscription: (options: {
        shortCode: string;
        keyword: string;
        phoneNumber: string;
        checkoutToken: string;
    }) => Promise<{
        "description": "Success" | "Failed";
        "token": string;
    }>;
}

interface TOKEN {
    generateAuthToken: () => Promise<{
        "description": "Success" | "Failed";
        "token": string;
    }>;
    createCheckoutToken: (phoneNumber: string) => Promise<{
        description: "Success" | "Failed";
        token: string;
    }>;
}

interface AfricasTalking {
    SMS: SMS;
    TOKEN: TOKEN;
}

export = africastalking;

declare function africastalking(
    options: { username: string; apiKey: string },
): AfricasTalking;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:04 GMT
  • Dependencies: none

Credits

These definitions were written by James Kaguru.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/africastalking

Weekly Downloads

136

Version

0.6.2

License

MIT

Unpacked Size

6.22 kB

Total Files

5

Last publish

Collaborators

  • types