Code Monkey home page Code Monkey logo

Comments (2)

 avatar commented on June 15, 2024 3

At this point we don't have typescript definitions -- but converting this SDK to typescript may be something we could look into in the future

thank you @bill-mybiz for the link, closing this

from alexa-skills-kit-sdk-for-nodejs.

 avatar commented on June 15, 2024

I've gone through those definitions @schodemeiss linked to, and I wanted to let you know that I also have a definition set a bit more filled out (including docs) already created if you wanted to just use that. It looks like they are 99% compatible. Slight differences, like instead of using literals in the type such as this in yours:

interface IRequest {
        type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
        requestId: string;
        timeStamp: string;
}

I have the following:

/** String literal with possible values. Used in place of an enum to allow string type. */
export type RequestType = 'LaunchRequest' | 'IntentRequest' | 'SessionEndedRequest';
export const RequestType = {
    LaunchRequest: 'LaunchRequest' as RequestType,
    IntentRequest: 'IntentRequest' as RequestType,
    SessionEndedRequest: 'SessionEndedRequest' as RequestType
};

/**
 * Request made to an Alexa skill. This is an "abstract base class" interface.
 *
 * Called "AlexaRequest" instead of just Request to show that this is not the "request" object per se, but specific to the Alexa domain.
 */
export interface AlexaRequest {
    /**
     * Type of concrete request.
     * @see RequestType
     * */
    type: RequestType,
    /** Represents the unique identifier for the specific request. */
    requestId: string
    /** Provides the date and time when Alexa sent the request. Use this to verify that the request is current and not part of a “replay” attack. Timestamp is provided as an ISO 8601 formatted string (for example, 2015-05-13T12:34:56Z). */
    timestamp: string,
}

I just wanted to let you know of the existence of this.

Also, as a side note, TypeScript recommends against prefixing interfaces with "I", so IRequest more idiomatically is Request.

from alexa-skills-kit-sdk-for-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.