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

1290 - Pinia #4089

Open
Luncher opened this issue Oct 24, 2021 · 0 comments
Open

1290 - Pinia #4089

Luncher opened this issue Oct 24, 2021 · 0 comments
Labels
1290 answer Share answers/solutions to a question en in English

Comments

@Luncher
Copy link

Luncher commented Oct 24, 2021

type ReturnX<T> = {
  [P in keyof T]: T[P] extends (...args: unknown[]) => infer R ? R : never
}

interface Options<S, G, A> {
  id: string
  state: () => S
  getters: G & ThisType<Readonly<S> & Readonly<ReturnX<G>>>
  actions: A & ThisType<S & Readonly<ReturnX<G>> & A>
}

declare function defineStore<S, G, A>(store: Options<S, G, A>): S & ReturnX<G> & A
@Luncher Luncher added answer Share answers/solutions to a question en in English labels Oct 24, 2021
@github-actions github-actions bot added the 1290 label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1290 answer Share answers/solutions to a question en in English
Projects
None yet
Development

No branches or pull requests

1 participant