Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript definitions #20

Open
louy opened this issue Dec 2, 2015 · 6 comments
Open

Typescript definitions #20

louy opened this issue Dec 2, 2015 · 6 comments

Comments

@louy
Copy link

louy commented Dec 2, 2015

Hi,

I'd be great if you add a typescript definitions file. I've created one for you already.

declare module 'merge' {
  function merge<A extends Object>(a: A): A;
  function merge<A extends Object, B>(a: A, b: B): A & B;
  function merge<A extends Object, B, C>(a: A, b: B, c: C): A & B & C;
  function merge<A extends Object, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D;
  function merge<A extends Object, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E;

  function merge<A extends Object>(recursive: boolean, a: A): A;
  function merge<A extends Object, B>(recursive: boolean, a: A, b: B): A & B;
  function merge<A extends Object, B, C>(recursive: boolean, a: A, b: B, c: C): A & B & C;
  function merge<A extends Object, B, C, D>(recursive: boolean, a: A, b: B, c: C, d: D): A & B & C & D;
  function merge<A extends Object, B, C, D, E>(recursive: boolean, a: A, b: B, c: C, d: D, e: E): A & B & C & D & E;

  namespace merge {
    function recursive<A extends Object>(a: A): A;
    function recursive<A extends Object, B>(a: A, b: B): A & B;
    function recursive<A extends Object, B, C>(a: A, b: B, c: C): A & B & C;
    function recursive<A extends Object, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D;
    function recursive<A extends Object, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E;
  }

  export = merge;
}

You'd make my life much easier :)

@dsebastien
Copy link

The type definitions should be included in a dedicated npm package, as recommended by the TypeScript team; that's now the way forward so that typings can be added as any other dependency to a project easily without necessarily requiring library releases for typings modifications (e.g., bug fixing)

@louy
Copy link
Author

louy commented Sep 20, 2016

Could you please add a reference?

@dsebastien
Copy link

@fenixphp
Copy link

So will the support for "typescript"?

@renarsvilnis
Copy link

Any updates on types? The library seems to be updated to typescript with v2.0.0 but not published to npm.

@Androz2091
Copy link

Yes and I'd like to use it for a project, but I don't want to have Github dependencies... So please publish the updated package to npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants