GithubHelp home page GithubHelp logo

discordjs / discord.js-typings Goto Github PK

View Code? Open in Web Editor NEW
49.0 11.0 15.0 461 KB

Official TypeScript type definitions for Discord.js

License: Other

TypeScript 100.00%
discord-js discord typescript typescript-definitions

discord.js-typings's Introduction

Typings for Discord.js

The official typings have been merged into the Discord.js repo and will continue to be updated there. Any further contributions/issues should be made to the typings on the official repo.

License

MIT

discord.js-typings's People

Contributors

appellation avatar bdistin avatar fyorl avatar icrawl avatar kzay avatar lewdcario avatar pgbiel avatar rezonant avatar shaybox avatar spaceeec avatar xdamon avatar yotaxp avatar zajrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord.js-typings's Issues

Make this a separate git repo

Yarn or pnpm doesn't work with git submodules. So it would be nice to separate it out from the master and also publish it as @types/discord.js

node_modules/discord.js/typings/index.d.ts(267,40): error TS2689: Cannot extend an interface 'Map'. Did you mean 'implements'?

it happens when compiling my ts project
"[email protected]",

you should just change
export class Collection<K, V> extends Map<K, V> {
into
export class Collection<K, V> implements Map<K, V> {
here is my tsconfig

{
    "compilerOptions": {
      /* Basic Options */
      "target": "ES5",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
      "module": "es2015",                         /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
      "sourceMap": true,                        /* Generates corresponding '.map' file. */
       "outDir": "./.build/",                    /* Redirect output structure to the directory. */

      /* Strict Type-Checking Options */
      "strict": true,                           /* Enable all strict type-checking options. */
       "noImplicitAny": true,                   /* Raise error on expressions and declarations with an implied 'any' type. */
       "strictNullChecks": true,                /* Enable strict null checks. */
       "strictFunctionTypes": true,             /* Enable strict checking of function types. */
       "noImplicitThis": true,                  /* Raise error on 'this' expressions with an implied 'any' type. */
       "alwaysStrict": true,                    /* Parse in strict mode and emit "use strict" for each source file. */
  
      /* Additional Checks */
       "noUnusedLocals": true,                  /* Report errors on unused locals. */
       "noUnusedParameters": true,              /* Report errors on unused parameters. */
       "noImplicitReturns": true,               /* Report error when not all code paths in function return a value. */
       "noFallthroughCasesInSwitch": true,       /* Report errors for fallthrough cases in switch statement. */
  
      /* Module Resolution Options */
       "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
    }
  }

package.json missing name

I'm unable to install the v10.0.0 typings via npm due to the package.json file not having name property.

$ npm install --save git+https://github.com/zajrik/discord.js-typings.git#de59a23685c90429719111a4d5b7bd1cf57b2031
...
npm ERR! No name provided in package.json
...

Cannot get typings to load

Hello, recently converted to TS with my discord bot. I'm having an issue where I can't get any of the discord.js typings to load at all.

Here is my tsconfig
07ae174df9ae7b553a95a654ade338e2

Here is my package.json
d33872f771f75fb2d668405476033958

and here is an example of it not working
unknown

Namespace naming conflicts and inconsistency

The namespace used, 'discord.js', is somewhat troublesome.

There is no way to represent the namespace name used in jsdoc.
The dot suggest there is a sub namespace, discord > js, and you can't put quotes around it.

Also, in the documentation for discord.js, it's always imported as Discord, thus it would make sense that the namespace is called Discord.

Make node types optional

when using Visual Studio 2017, there is a clash of the declarations installed with this and visual studio's built in node definitions.

(an alternative solution would be to find a way to turn VS's built in definitions off)

image

DMChannel.send() return type wrong?

The return type for DMChannel.send() is string in index.d.ts, but according to the discord.js documentation this should be Promise<Message | Message[]> as it is for GroupDMChannel and TextChannel.

discord.js 11.3.0 errors

node_modules/discord.js/typings/index.d.ts(60,23): error TS2304: Cannot find name 'Set'. node_modules/discord.js/typings/index.d.ts(62,22): error TS2304: Cannot find name 'Set'. node_modules/discord.js/typings/index.d.ts(267,40): error TS2304: Cannot find name 'Map'. node_modules/discord.js/typings/index.d.ts(1182,20): error TS2304: Cannot find name 'Map'. node_modules/discord.js/typings/index.d.ts(1333,23): error TS2304: Cannot find name 'Set'. node_modules/discord.js/typings/index.d.ts(1334,22): error TS2304: Cannot find name 'Set'.

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.