@ngx-signal-store-query/core
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "@ngx-signal-store-query/core", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Signal Store feature that bridges with Angular Query", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import { type Prettify, type SignalStoreFeatureResult, type StateSignals, type WritableStateSource } from '@ngrx/signals'; | ||
import { type CreateMutationOptions, type CreateMutationResult, type CreateQueryResult, type injectQuery } from '@tanstack/angular-query-experimental'; | ||
import type { QueryClient } from '@tanstack/query-core'; | ||
export type CreateQueryFn<TDataFn = unknown, TData = TDataFn, TError = Error, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult> = (store: QueryStore<Input>) => QueryFactory<TDataFn, TData, TError>; | ||
import { type CreateMutationOptions, type CreateMutationResult, type CreateQueryOptions, type CreateQueryResult } from '@tanstack/angular-query-experimental'; | ||
import { type QueryClient } from '@tanstack/query-core'; | ||
export type QueryStore<Input extends SignalStoreFeatureResult> = Prettify<StateSignals<Input['state']> & Input['computed'] & Input['methods'] & WritableStateSource<Prettify<Input['state']>>>; | ||
export type CreateQueryFn<TDataFn = unknown, TError = Error, TData = TDataFn, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult> = (store: QueryStore<Input>) => (client: QueryClient) => CreateQueryOptions<TDataFn, TError, TData>; | ||
export type QueryProp<Name extends string> = `${Uncapitalize<Name>}Query`; | ||
export type QueryMethod<TData = unknown, TError = Error> = (() => CreateQueryResult<TData, TError>) & CreateQueryResult<TData, TError>; | ||
export type QueryStore<Input extends SignalStoreFeatureResult> = Prettify<StateSignals<Input['state']> & Input['computed'] & Input['methods'] & WritableStateSource<Prettify<Input['state']>>>; | ||
export type QueryFactory<TDataFn = unknown, TData = TDataFn, TError = Error> = Parameters<typeof injectQuery<TDataFn, TError, TData>>[0]; | ||
export type CreateMutationFn<TData = unknown, TError = Error, TVariables = void, TContext = unknown, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult> = (store: QueryStore<Input>) => (client: QueryClient) => CreateMutationOptions<TData, TError, TVariables, TContext>; | ||
export type MutationProp<Name extends string> = `${Uncapitalize<Name>}Mutation`; | ||
export type MutationMethod<TData = unknown, TError = Error, TVariables = void, TContext = unknown> = (() => CreateMutationResult<TData, TError, TVariables, TContext>) & CreateMutationResult<TData, TError, TVariables, TContext>; |
import { type EmptyFeatureResult, type SignalStoreFeature, type SignalStoreFeatureResult } from '@ngrx/signals'; | ||
import { type CreateMutationFn, type MutationMethod, type MutationProp } from './types'; | ||
export declare const withMutation: <Name extends string, TData = unknown, TError = Error, TVariables = void, TContext = unknown, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult>(name: Name, createMutationFn: CreateMutationFn<TData, TError, TVariables, TContext, Input>) => SignalStoreFeature<Input, EmptyFeatureResult & { | ||
methods: Record<MutationProp<Name>, MutationMethod<TData, TError, TVariables, TContext>>; | ||
export declare const withMutation: <Name extends string, TData = unknown, TError = Error, TVariables = void, TContext = unknown, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult>(name: Name, createMutationFn: CreateMutationFn<TData, TError, TVariables, TContext, NoInfer<Input>>) => SignalStoreFeature<Input, EmptyFeatureResult & { | ||
methods: Record<MutationProp<NoInfer<Name>>, MutationMethod<NoInfer<TData>, NoInfer<TError>, NoInfer<TVariables>, NoInfer<TContext>>>; | ||
}>; |
import { type EmptyFeatureResult, type SignalStoreFeature, type SignalStoreFeatureResult } from '@ngrx/signals'; | ||
import { type CreateQueryFn, type QueryMethod, type QueryProp } from './types'; | ||
export declare const withQuery: <Name extends string, TDataFn = unknown, TData = TDataFn, TError = Error, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult>(name: Name, createQueryFn: CreateQueryFn<TDataFn, TData, TError, Input>) => SignalStoreFeature<Input, EmptyFeatureResult & { | ||
methods: Record<QueryProp<Name>, QueryMethod<TData, TError>>; | ||
export declare const withQuery: <Name extends string, TDataFn = unknown, TError = Error, TData = TDataFn, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult>(name: Name, createQueryFn: CreateQueryFn<TDataFn, TError, TData, NoInfer<Input>>) => SignalStoreFeature<Input, EmptyFeatureResult & { | ||
methods: Record<QueryProp<NoInfer<Name>>, QueryMethod<NoInfer<TData>, NoInfer<TError>>>; | ||
}>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26042
115