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 types declaration file #20

Open
geopic opened this issue Jan 30, 2020 · 5 comments
Open

TypeScript types declaration file #20

geopic opened this issue Jan 30, 2020 · 5 comments

Comments

@geopic
Copy link

geopic commented Jan 30, 2020

This npm package needs a TypeScript types declaration file so that developers who enjoy writing with TS can use it with this package and have a better development experience. Would you like me to write one?

@wimpheling
Copy link

I would love to have this... Now i'm losing all the typescript typing of objection if using this plugin :/

@geopic
Copy link
Author

geopic commented Mar 1, 2020

Just waiting for confirmation from anybody to go ahead...

@mikiastilahun
Copy link

@geopic Is this done yet? If not what can I do to still use this package and have typescript support for my models? Thanks

@josemak25
Copy link

A temporary fix for typescript typings

declare module 'objection-unique' {
  import { Model } from 'objection';

  interface Options {
    fields: (string | string[])[];
    identifiers: string[];
  }

  export default function (
    options?: Options
  ): <T extends typeof Model>(model: T) => T;
}

@geopic
Copy link
Author

geopic commented Feb 13, 2021

@mikiastilahun I've just been waiting for a response just so I know the maintainers are alive and accepting PRs but if @josemak25's solution works then I guess we can leave it at that. 🤷‍♂️ . Let me know if @josemak25's solution works 100% and I'll close this issue. 🙂

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

4 participants