New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ngxs/store

Package Overview
Dependencies
Maintainers
1
Versions
1361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngxs/store - npm Package Compare versions

Comparing version 3.8.2 to 18.0.0-dev.master-0108915

esm2022/experimental/index.mjs

2

index.d.ts

@@ -10,4 +10,4 @@ /**

/**
* Private exports required for the Ivy compilation.
* Private exports required for the compilation.
*/
export * from './src/private_api';

@@ -1,5 +0,9 @@

export { NgxsBootstrapper } from './ngxs-bootstrapper';
export { memoize } from './memoize';
export { INITIAL_STATE_TOKEN, InitialState } from './initial-state';
export { PlainObjectOf, PlainObject, StateClass } from './symbols';
export * from './symbols';
export * from './metadata';
export { ɵmemoize } from './memoize';
export { StateToken } from './state-token';
export { ɵINITIAL_STATE_TOKEN, ɵInitialState } from './initial-state';
export { ɵNgxsAppBootstrappedState } from './ngxs-app-bootstrapped-state';
export { ɵNGXS_STATE_CONTEXT_FACTORY, ɵNGXS_STATE_FACTORY } from './internal-tokens';
export { ɵOrderedSubject, ɵOrderedBehaviorSubject } from './custom-rxjs-subjects';
export { ɵStateStream } from './state-stream';
import { InjectionToken } from '@angular/core';
import { PlainObject } from './symbols';
export declare class InitialState {
import { ɵPlainObject } from './symbols';
export declare class ɵInitialState {
private static _value;
static set(state: PlainObject): void;
static pop(): PlainObject;
static set(state: ɵPlainObject): void;
static pop(): ɵPlainObject;
}
export declare const INITIAL_STATE_TOKEN: InjectionToken<any>;
export declare const ɵINITIAL_STATE_TOKEN: InjectionToken<ɵPlainObject>;

@@ -8,3 +8,3 @@ declare function defaultEqualityCheck(a: any, b: any): boolean;

*/
export declare function memoize<T extends (...args: any[]) => any>(func: T, equalityCheck?: typeof defaultEqualityCheck): T;
export declare function ɵmemoize<T extends (...args: any[]) => any>(func: T, equalityCheck?: typeof defaultEqualityCheck): T;
export {};

@@ -1,7 +0,88 @@

export interface PlainObject {
import type { StateToken } from './state-token';
export interface ɵPlainObject {
[key: string]: any;
}
export interface PlainObjectOf<T> {
export interface ɵPlainObjectOf<T> {
[key: string]: T;
}
export declare type StateClass<T = any> = new (...args: any[]) => T;
export type ɵStateClass<T = any> = new (...args: any[]) => T;
export declare const ɵMETA_KEY = "NGXS_META";
export declare const ɵMETA_OPTIONS_KEY = "NGXS_OPTIONS_META";
export declare const ɵSELECTOR_META_KEY = "NGXS_SELECTOR_META";
export interface ɵStateToken<T, U> {
new (name: ɵTokenName<T>): U;
getName(): string;
toString(): string;
}
type RequireGeneric<T, U> = T extends void ? 'You must provide a type parameter' : U;
export type ɵTokenName<T> = string & RequireGeneric<T, string>;
export type ɵExtractTokenType<P> = P extends StateToken<infer T> ? T : never;
/**
* Options that can be provided to the store.
*/
export interface ɵStoreOptions<T> {
/**
* Name of the state. Required.
*/
name: string | StateToken<T>;
/**
* Default values for the state. If not provided, uses empty object.
*/
defaults?: T;
/**
* Sub states for the given state.
*
* @deprecated
* Read the deprecation notice at this link: https://ngxs.io/deprecations/sub-states-deprecation.
*/
children?: ɵStateClass[];
}
export interface ɵStateClassInternal<T = any, U = any> extends ɵStateClass<T> {
[ɵMETA_KEY]?: ɵMetaDataModel;
[ɵMETA_OPTIONS_KEY]?: ɵStoreOptions<U>;
}
export interface ɵMetaDataModel {
name: string | null;
actions: ɵPlainObjectOf<ɵActionHandlerMetaData[]>;
defaults: any;
path: string | null;
makeRootSelector: ɵSelectorFactory | null;
/** @deprecated */
children?: ɵStateClassInternal[];
}
export interface ɵSelectorMetaDataModel {
makeRootSelector: ɵSelectorFactory | null;
originalFn: Function | null;
containerClass: any;
selectorName: string | null;
getSelectorOptions: () => ɵSharedSelectorOptions;
}
export interface ɵSharedSelectorOptions {
/**
* @deprecated
* Read the deprecation notice at this link: https://ngxs.io/deprecations/inject-container-state-deprecation.md.
*/
injectContainerState?: boolean;
suppressErrors?: boolean;
}
export interface ɵRuntimeSelectorContext {
getStateGetter(key: any): (state: any) => any;
getSelectorOptions(localOptions?: ɵSharedSelectorOptions): ɵSharedSelectorOptions;
}
export type ɵSelectFromRootState = (rootState: any) => any;
export type ɵSelectorFactory = (runtimeContext: ɵRuntimeSelectorContext) => ɵSelectFromRootState;
/**
* Actions that can be provided in a action decorator.
*/
export interface ɵActionOptions {
/**
* Cancel the previous uncompleted observable(s).
*/
cancelUncompleted?: boolean;
}
export interface ɵActionHandlerMetaData {
fn: string | symbol;
options: ɵActionOptions;
type: string;
}
export {};

@@ -7,3 +7,3 @@ import { AfterViewInit, OnInit } from '@angular/core';

static ɵfac: i0.ɵɵFactoryDeclaration<NgxsTestComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxsTestComponent, "app-root", never, {}, {}, never, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxsTestComponent, "app-root", never, {}, {}, never, never, false, never>;
}

@@ -0,4 +1,4 @@

export { freshPlatform } from './fresh-platform';
export { NgxsTestBed } from './ngxs.setup';
export { skipConsoleLogging } from './skip-console-logging';
export { NgxsTesting } from './symbol';
export { freshPlatform } from './fresh-platform';
export { skipConsoleLogging } from './skip-console-logging';
import { NgxsModuleOptions, Store } from '@ngxs/store';
import { ModuleWithProviders } from '@angular/core';
import { TestBedStatic } from '@angular/core/testing';
import { StateClass } from '@ngxs/store/internals';
import { ɵStateClass } from '@ngxs/store/internals';
export interface NgxsOptionsTesting {
states?: StateClass[];
states?: ɵStateClass[];
ngxsOptions?: NgxsModuleOptions;

@@ -8,0 +8,0 @@ imports?: ModuleWithProviders<any>[];

import { NoInfer, StateOperator } from './types';
declare type NotUndefined<T> = T extends undefined ? never : T;
export declare type ɵPatchSpec<T> = {
type NotUndefined<T> = T extends undefined ? never : T;
export type ɵPatchSpec<T> = {
[P in keyof T]?: T[P] | StateOperator<NotUndefined<T[P]>>;

@@ -5,0 +5,0 @@ };

@@ -1,2 +0,2 @@

declare type _NoInfer<T> = T extends infer S ? S : never;
type _NoInfer<T> = T extends infer S ? S : never;
/**

@@ -32,3 +32,3 @@ * Blocks the ability of the typescript inferrence engine to be able to use the provided type as part of

*/
export declare type NoInfer<T> = T extends (infer O)[] ? _NoInfer<O>[] : _NoInfer<T>;
export type NoInfer<T> = T extends (infer O)[] ? _NoInfer<O>[] : _NoInfer<T>;
/**

@@ -42,3 +42,3 @@ * IMPORTANT NOTE: This should not be used externally to the library, rather

*/
declare type ɵAsReadonly<T> = T extends Readonly<infer O> ? (O extends T ? Readonly<T> : T) : T;
type ɵAsReadonly<T> = T extends Readonly<infer O> ? (O extends T ? Readonly<T> : T) : T;
/**

@@ -48,3 +48,3 @@ * Represents the existing state that is passed into a `StateOperator` which should

*/
export declare type ExistingState<T> = T extends any ? ɵAsReadonly<T> : never;
export type ExistingState<T> = T extends any ? ɵAsReadonly<T> : never;
/**

@@ -58,3 +58,3 @@ * This is a monotype unary function that is used to create a new state from an existing state.

*/
export declare type StateOperator<T> = (existing: ExistingState<T>) => T;
export type StateOperator<T> = (existing: ExistingState<T>) => T;
export {};
import { StateOperator } from './types';
export declare type Predicate<T = any> = (value: T | Readonly<T>) => boolean;
export type Predicate<T = any> = (value: T | Readonly<T>) => boolean;
export declare function isStateOperator<T>(value: T | StateOperator<T>): value is StateOperator<T>;

@@ -4,0 +4,0 @@ export declare function isUndefined(value: any): value is undefined;

{
"$schema": "../../node_modules/ng-packagr/package.schema.json",
"name": "@ngxs/store",
"version": "3.8.2",
"version": "18.0.0-dev.master-0108915",
"license": "MIT",
"sideEffects": true,
"sideEffects": false,
"peerDependencies": {
"@angular/core": ">=12.0.0 <18.0.0",
"rxjs": ">=6.5.5"
"@angular/core": ">=16.0.0 <19.0.0",
"rxjs": ">=7.0.0"
},
"main": "bundles/ngxs-store.umd.js",
"module": "fesm2015/ngxs-store.js",
"es2015": "fesm2015/ngxs-store.js",
"esm2015": "esm2015/ngxs-store.js",
"fesm2015": "fesm2015/ngxs-store.js",
"typings": "ngxs-store.d.ts",
"schematics": "./schematics/collection.json",
"module": "fesm2022/ngxs-store.mjs",
"typings": "index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"esm2022": "./esm2022/ngxs-store.mjs",
"esm": "./esm2022/ngxs-store.mjs",
"default": "./fesm2022/ngxs-store.mjs"
},
"./experimental": {
"types": "./experimental/index.d.ts",
"esm2022": "./esm2022/experimental/ngxs-store-experimental.mjs",
"esm": "./esm2022/experimental/ngxs-store-experimental.mjs",
"default": "./fesm2022/ngxs-store-experimental.mjs"
},
"./internals": {
"types": "./internals/index.d.ts",
"esm2022": "./esm2022/internals/ngxs-store-internals.mjs",
"esm": "./esm2022/internals/ngxs-store-internals.mjs",
"default": "./fesm2022/ngxs-store-internals.mjs"
},
"./operators": {
"types": "./operators/index.d.ts",
"esm2022": "./esm2022/operators/ngxs-store-operators.mjs",
"esm": "./esm2022/operators/ngxs-store-operators.mjs",
"default": "./fesm2022/ngxs-store-operators.mjs"
},
"./plugins": {
"types": "./plugins/index.d.ts",
"esm2022": "./esm2022/plugins/ngxs-store-plugins.mjs",
"esm": "./esm2022/plugins/ngxs-store-plugins.mjs",
"default": "./fesm2022/ngxs-store-plugins.mjs"
},
"./internals/testing": {
"types": "./internals/testing/index.d.ts",
"esm2022": "./esm2022/internals/testing/ngxs-store-internals-testing.mjs",
"esm": "./esm2022/internals/testing/ngxs-store-internals-testing.mjs",
"default": "./fesm2022/ngxs-store-internals-testing.mjs"
}
},
"dependencies": {
"tslib": "^2.2.0"
"tslib": "^2.3.0"
},

@@ -63,2 +100,2 @@ "repository": {

}
}
}
<p align="center">
<img src="https://github.com/ngxs/store/raw/master/docs/assets/logo.png">
<figure><picture><source srcset="https://github.com/ngxs/store/raw/master/docs/assets/ngxs-logo_dark_theme.png" media="(prefers-color-scheme: dark)"><img src="https://github.com/ngxs/store/raw/master/docs/assets/ngxs-logo_light_theme.png" alt="" width="250"></picture></figure>
<br />

@@ -7,3 +7,5 @@ NGXS is a state management pattern + library for Angular

<br />
<a href="https://join.slack.com/t/ngxs/shared_invite/zt-by26i24h-2CC5~vqwNCiZa~RRibh60Q"><img src="https://img.shields.io/badge/slack-join%20us-blue.svg?style=flat&logo=slack"></a> <a href="https://badge.fury.io/js/%40ngxs%2Fstore"><img src="https://badge.fury.io/js/%40ngxs%2Fstore.svg"></a> <a href="https://codeclimate.com/github/ngxs/store/maintainability"><img src="https://api.codeclimate.com/v1/badges/5b43106a1ddff7d76a04/maintainability" /></a> <a href="https://codeclimate.com/github/ngxs/store/test_coverage"><img src="https://api.codeclimate.com/v1/badges/5b43106a1ddff7d76a04/test_coverage" /></a> <a href="https://circleci.com/gh/ngxs/store"><img src="https://circleci.com/gh/ngxs/store/tree/master.svg?style=svg"></a>
<a href="https://discord.com/channels/1008573955587702894">
<img alt="Discord" src="https://img.shields.io/discord/1008573955587702894?style=flat-square&logo=discord&label=discord&link=https%3A%2F%2Fdiscord.com%2Fchannels%2F1008573955587702894">
</a> <a href="https://badge.fury.io/js/%40ngxs%2Fstore"><img src="https://badge.fury.io/js/%40ngxs%2Fstore.svg"></a> <a href="https://codeclimate.com/github/ngxs/store/maintainability"><img src="https://api.codeclimate.com/v1/badges/5b43106a1ddff7d76a04/maintainability" /></a> <a href="https://codeclimate.com/github/ngxs/store/test_coverage"><img src="https://api.codeclimate.com/v1/badges/5b43106a1ddff7d76a04/test_coverage" /></a> <a href="https://circleci.com/gh/ngxs/store"><img src="https://circleci.com/gh/ngxs/store/tree/master.svg?style=svg"></a>
</p>

@@ -17,2 +19,2 @@

- 🗄 Learn about updates from the [changelog](https://github.com/ngxs/store/blob/master/CHANGELOG.md)
- ❤️ Give back by becoming a [Contributor](https://github.com/ngxs/store/blob/master/docs/community/contributing.md) or a [Sponsor](https://github.com/ngxs/store/blob/master/docs/community/sponsors.md)
- ❤️ Give back by becoming a [Contributor](https://github.com/ngxs/store/blob/master/docs/community-and-labs/community/contributing.md) or a [Sponsor](https://github.com/ngxs/store/blob/master/docs/community-and-labs/community/sponsors.md)
import { OnDestroy } from '@angular/core';
import { ɵOrderedSubject } from '@ngxs/store/internals';
import { Observable } from 'rxjs';
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
import { OrderedSubject } from './internal/custom-rxjs-subjects';
import * as i0 from "@angular/core";

@@ -23,3 +23,3 @@ /**

*/
export declare class InternalActions extends OrderedSubject<ActionContext> implements OnDestroy {
export declare class InternalActions extends ɵOrderedSubject<ActionContext> implements OnDestroy {
ngOnDestroy(): void;

@@ -26,0 +26,0 @@ static ɵfac: i0.ɵɵFactoryDeclaration<InternalActions, never>;

@@ -1,21 +0,7 @@

export interface ActionDef<T = any, U = any> {
export interface ActionDef<TArgs extends any[] = any[], TReturn = any> {
type: string;
new (...args: T[]): U;
new (...args: TArgs): TReturn;
}
export declare type ActionType = ActionDef | {
export type ActionType = ActionDef | {
type: string;
};
/**
* Actions that can be provided in a action decorator.
*/
export interface ActionOptions {
/**
* Cancel the previous uncompleted observable(s).
*/
cancelUncompleted?: boolean;
}
export interface ActionHandlerMetaData {
fn: string | symbol;
options: ActionOptions;
type: string;
}

@@ -0,1 +1,2 @@

import { ɵPlainObject } from '@ngxs/store/internals';
export declare function throwStateNameError(name: string): never;

@@ -8,5 +9,6 @@ export declare function throwStateNamePropertyError(): never;

export declare function getZoneWarningMessage(): string;
export declare function getUndecoratedStateInIvyWarningMessage(name: string): string;
export declare function getUndecoratedStateWithInjectableWarningMessage(name: string): string;
export declare function getInvalidInitializationOrderMessage(addedStates?: ɵPlainObject): string;
export declare function throwSelectFactoryNotConnectedError(): never;
export declare function throwPatchingArrayError(): never;
export declare function throwPatchingPrimitiveError(): never;

@@ -1,5 +0,30 @@

import { ActionType, ActionOptions } from '../actions/symbols';
import { ɵActionOptions } from '@ngxs/store/internals';
import { ActionDef, ActionType } from '../actions/symbols';
import { StateContext } from '../symbols';
/**
* Decorates a method with a action information.
* Given an action class, returns its payload.
*/
export declare function Action(actions: ActionType | ActionType[], options?: ActionOptions): MethodDecorator;
type ActionToPayload<Action extends ActionType> = Action extends ActionDef<any, infer ActionPayload> ? ActionPayload : never;
/**
* Given a list of action classes, returns the union of their payloads.
*/
type ActionsToPayload<Actions extends readonly ActionType[]> = {
[K in keyof Actions]: ActionToPayload<Actions[K]>;
}[number];
/**
* Given an action class or a list of action classes, returns the union of their payloads.
*/
type ActionOrActionsToPayload<ActionOrActions> = ActionOrActions extends ActionType ? ActionToPayload<ActionOrActions> : ActionOrActions extends ActionType[] ? ActionsToPayload<ActionOrActions> : never;
/**
* Describes what methods can be decorated with an `@Action` decorator that has been passed the given action(s).
*/
type HandlerTypedPropertyDescriptor<ActionOrActions> = TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(stateContext: StateContext<any>) => any> | TypedPropertyDescriptor<(stateContext: StateContext<any>, action: ActionOrActionsToPayload<ActionOrActions>) => any>;
/**
* The result of a call to the `@Action()` decorator with the given action(s) as its first argument.
*/
type ActionDecorator<ActionOrActions extends ActionType | ActionType[]> = (target: any, name: string | symbol, _descriptor: HandlerTypedPropertyDescriptor<ActionOrActions>) => void;
/**
* Decorates a method with action information.
*/
export declare function Action<ActionOrActions extends ActionType | ActionType[]>(actions: ActionOrActions, options?: ɵActionOptions): ActionDecorator<ActionOrActions>;
export {};
/**
* Decorator for selecting a slice of state from the store.
*
* @deprecated
* Read the deprecation notice at this link: https://ngxs.io/deprecations/select-decorator-deprecation.
*/
export declare function Select<T>(rawSelector?: T, ...paths: string[]): PropertyDecorator;
import { Observable } from 'rxjs';
import { StateToken } from '../../state-token/state-token';
import { ExtractTokenType } from '../../state-token/symbols';
import { ɵExtractTokenType, StateToken } from '@ngxs/store/internals';
export declare function createSelectObservable<T = any>(selector: any): Observable<T>;

@@ -10,2 +9,2 @@ export declare function createSelectorFn(name: string, rawSelector?: any, paths?: string[]): any;

export declare function removeDollarAtTheEnd(name: string): string;
export declare type PropertyType<T> = T extends StateToken<any> ? Observable<ExtractTokenType<T>> : T extends (...args: any[]) => any ? Observable<ReturnType<T>> : any;
export type PropertyType<T> = T extends StateToken<any> ? Observable<ɵExtractTokenType<T>> : T extends (...args: any[]) => any ? Observable<ReturnType<T>> : any;

@@ -1,5 +0,5 @@

import { SharedSelectorOptions } from '../internal/internals';
import { ɵSharedSelectorOptions } from '@ngxs/store/internals';
/**
* Decorator for setting selector options at a method or class level.
*/
export declare function SelectorOptions(options: SharedSelectorOptions): ClassDecorator & MethodDecorator;
export declare function SelectorOptions(options: ɵSharedSelectorOptions): ClassDecorator & MethodDecorator;

@@ -1,3 +0,2 @@

import { SelectorDef } from '../../selectors';
import { SelectorType } from './symbols';
import { SelectorDefTuple, SelectorType } from './symbols';
/**

@@ -10,2 +9,2 @@ * Decorator for creating a state selector for the current state.

*/
export declare function Selector<T extends SelectorDef<any>>(selectors: T[]): SelectorType<T>;
export declare function Selector<T extends SelectorDefTuple>(selectors: T): SelectorType<T>;

@@ -1,4 +0,73 @@

import { StateToken } from '../../state-token/state-token';
import { ExtractTokenType } from '../../state-token/symbols';
export declare type SelectorSpec<T, U> = [T] extends [never] ? ((...states: any[]) => any) : (T extends StateToken<any> ? (state: ExtractTokenType<T>) => U : (...states: any[]) => any);
export declare type SelectorType<T> = <U>(target: any, key: string | symbol, descriptor: TypedPropertyDescriptor<SelectorSpec<T, U>>) => TypedPropertyDescriptor<SelectorSpec<T, U>> | void;
import { ɵSelectorDef, ɵSelectorReturnType } from '../../selectors';
/**
* Defines a tuple of selector functions, state tokens, and state classes that a selector decorated
* by `@Selector()` can depend on.
*/
export type SelectorDefTuple = ɵSelectorDef<any>[] | [ɵSelectorDef<any>];
type UnknownToAny<T> = unknown extends T ? any : T;
type EnsureArray<T> = T extends any[] ? T : never;
/**
* Given a tuple of selector functions, state tokens, state classes, etc., returns a tuple of what
* a dependent selector would expect to receive for that parent as an argument when called.
*
* For example, if the first element in `ParentsTuple` is a selector function that returns a
* `number`, then the first element of the result tuple will be `number`. If the second element
* in `ParentsTuple` is a state class with model `{ name: string }`, then the second element of
* the result tuple will be `{ name: string }`.
*/
type SelectorReturnTypeList<ParentsTuple extends SelectorDefTuple> = EnsureArray<{
[ParentsTupleIndex in keyof ParentsTuple]: ParentsTuple[ParentsTupleIndex] extends ɵSelectorDef<any> ? UnknownToAny<ɵSelectorReturnType<ParentsTuple[ParentsTupleIndex]>> : never;
}>;
/**
* Defines a selector function matching a given argument list of parent selectors/states/tokens
* and a given return type.
*/
export type SelectorSpec<ParentsTuple, Return> = ParentsTuple extends [] ? () => any : ParentsTuple extends SelectorDefTuple ? (...states: SelectorReturnTypeList<ParentsTuple>) => Return : () => any;
/**
* Defines a selector function matching `SelectorSpec<ParentsTuple, Return>` but with the assumption that the
* container state has been injected as the first argument.
*/
type SelectorSpecWithInjectedState<ParentsTuple, Return> = SelectorSpec<ParentsTuple extends SelectorDefTuple ? [any, ...ParentsTuple] : [any], ParentsTuple extends SelectorDefTuple ? Return : any>;
/**
* Defines a property descriptor for the `@Selector` decorator that decorates a function with
* parent selectors/states/tokens `ParentsTuple` and return type `Return`.
*/
type DescriptorWithNoInjectedState<ParentsTuple, Return> = TypedPropertyDescriptor<SelectorSpec<ParentsTuple, Return>>;
/**
* Same as `DescriptorWithNoInjectedState` but with state injected as the first argument.
*/
type DescriptorWithInjectedState<ParentsTuple, Return> = TypedPropertyDescriptor<SelectorSpecWithInjectedState<ParentsTuple, Return>>;
type DecoratorArgs<Descriptor> = [target: any, key: string | symbol, descriptor?: Descriptor];
/**
* Defines the return type of a call to `@Selector` when there is no argument given
* (e.g. `@Selector()` counts, but `@Selector([])` does not)
*
* This result is a decorator that can only be used to decorate a function with no arguments or a
* single argument that is the container state.
*/
type SelectorTypeNoDecoratorArgs = {
<Return>(...args: DecoratorArgs<DescriptorWithNoInjectedState<unknown, Return>>): void | DescriptorWithNoInjectedState<unknown, Return>;
<Return>(...args: DecoratorArgs<DescriptorWithInjectedState<unknown, Return>>): void | DescriptorWithInjectedState<unknown, Return>;
};
/**
* Defines the return type of a call to `@Selector` when there is an argument given.
* (e.g. `@Selector([])` counts, but `@Selector()` does not)
*
* This result is a decorator that can only be used to decorate a function with an argument list
* matching the results of the tuple of parents `ParentsTuple`.
*/
type SelectorTypeWithDecoratorArgs<ParentsTuple> = {
<Return>(...args: DecoratorArgs<DescriptorWithNoInjectedState<ParentsTuple, Return>>): void | DescriptorWithNoInjectedState<ParentsTuple, Return>;
/**
* @deprecated
* Read the deprecation notice at this link: https://ngxs.io/deprecations/inject-container-state-deprecation.md.
*/
<Return>(...args: DecoratorArgs<DescriptorWithInjectedState<ParentsTuple, Return>>): void | DescriptorWithInjectedState<ParentsTuple, Return>;
};
/**
* Defines the return type of a call to `@Selector`. This result is a decorator that can only be
* used to decorate a function with an argument list matching `ParentsTuple`, the results of the
* tuple of parent selectors/state tokens/state classes.
*/
export type SelectorType<ParentsTuple> = unknown extends ParentsTuple ? SelectorTypeNoDecoratorArgs : SelectorTypeWithDecoratorArgs<ParentsTuple>;
export {};

@@ -1,6 +0,5 @@

import { StateClass } from '@ngxs/store/internals';
import { StoreOptions } from '../symbols';
import { ɵStateClass, ɵStoreOptions } from '@ngxs/store/internals';
/**
* Decorates a class with ngxs state information.
*/
export declare function State<T>(options: StoreOptions<T>): (target: StateClass) => void;
export declare function State<T>(options: ɵStoreOptions<T>): (target: ɵStateClass) => void;

@@ -10,1 +10,2 @@ import { ModuleWithProviders } from '@angular/core';

}
export declare function withNgxsDevelopmentOptions(options: NgxsDevelopmentOptions): import("@angular/core").EnvironmentProviders;
import { InjectionToken, Type } from '@angular/core';
/**
* The strategy that might be provided by users through `options.executionStrategy`.
* Consumers have the option to utilize the execution strategy provided by
* `NgxsModule.forRoot({executionStrategy})` or `provideStore([], {executionStrategy})`.
*/
export declare const USER_PROVIDED_NGXS_EXECUTION_STRATEGY: InjectionToken<Type<NgxsExecutionStrategy> | undefined>;
export declare const CUSTOM_NGXS_EXECUTION_STRATEGY: InjectionToken<Type<NgxsExecutionStrategy> | undefined>;
/**
* The injection token is used internally to resolve an instance of the execution
* strategy. It checks whether consumers have provided their own `executionStrategy`
* and also verifies if we are operating in a zone-aware environment.
*/
export declare const NGXS_EXECUTION_STRATEGY: InjectionToken<NgxsExecutionStrategy>;

@@ -7,0 +13,0 @@ export interface NgxsExecutionStrategy {

@@ -0,5 +1,5 @@

import { NgZone } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { InternalErrorReporter } from './error-handler';
import { ɵStateStream } from '@ngxs/store/internals';
import { ActionContext, InternalActions } from '../actions-stream';
import { StateStream } from './state-stream';
import { PluginManager } from '../plugin-manager';

@@ -19,2 +19,3 @@ import { InternalNgxsExecutionStrategy } from '../execution/internal-ngxs-execution-strategy';

export declare class InternalDispatcher {
private _ngZone;
private _actions;

@@ -25,8 +26,7 @@ private _actionResults;

private _ngxsExecutionStrategy;
private _internalErrorReporter;
constructor(_actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: StateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy, _internalErrorReporter: InternalErrorReporter);
constructor(_ngZone: NgZone, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: ɵStateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy);
/**
* Dispatches event(s).
*/
dispatch(actionOrActions: any | any[]): Observable<any>;
dispatch(actionOrActions: any | any[]): Observable<void>;
private dispatchByEvents;

@@ -33,0 +33,0 @@ private dispatchSingle;

@@ -1,45 +0,16 @@

import { PlainObjectOf, StateClass } from '@ngxs/store/internals';
import { InjectionToken } from '@angular/core';
import { Observable } from 'rxjs';
import { META_KEY, META_OPTIONS_KEY, NgxsConfig, StoreOptions } from '../symbols';
import { ActionHandlerMetaData } from '../actions/symbols';
export interface StateClassInternal<T = any, U = any> extends StateClass<T> {
[META_KEY]?: MetaDataModel;
[META_OPTIONS_KEY]?: StoreOptions<U>;
}
export declare type StateKeyGraph = PlainObjectOf<string[]>;
export declare type StatesByName = PlainObjectOf<StateClassInternal>;
import { ɵPlainObjectOf, ɵStateClassInternal, ɵActionHandlerMetaData } from '@ngxs/store/internals';
import { NgxsConfig } from '../symbols';
export type StateKeyGraph = ɵPlainObjectOf<string[]>;
export type StatesByName = ɵPlainObjectOf<ɵStateClassInternal>;
export interface StateOperations<T> {
getState(): T;
setState(val: T): T;
setState(val: T): void;
dispatch(actionOrActions: any | any[]): Observable<void>;
}
export interface MetaDataModel {
name: string | null;
actions: PlainObjectOf<ActionHandlerMetaData[]>;
defaults: any;
path: string | null;
makeRootSelector: SelectorFactory | null;
children?: StateClassInternal[];
}
export interface RuntimeSelectorContext {
getStateGetter(key: any): (state: any) => any;
getSelectorOptions(localOptions?: SharedSelectorOptions): SharedSelectorOptions;
}
export declare type SelectFromRootState = (rootState: any) => any;
export declare type SelectorFactory = (runtimeContext: RuntimeSelectorContext) => SelectFromRootState;
export interface SharedSelectorOptions {
injectContainerState?: boolean;
suppressErrors?: boolean;
}
export interface SelectorMetaDataModel {
makeRootSelector: SelectorFactory | null;
originalFn: Function | null;
containerClass: any;
selectorName: string | null;
getSelectorOptions: () => SharedSelectorOptions;
}
export interface MappedStore {
name: string;
isInitialised: boolean;
actions: PlainObjectOf<ActionHandlerMetaData[]>;
actions: ɵPlainObjectOf<ɵActionHandlerMetaData[]>;
defaults: any;

@@ -54,26 +25,2 @@ instance: any;

/**
* Ensures metadata is attached to the class and returns it.
*
* @ignore
*/
export declare function ensureStoreMetadata(target: StateClassInternal): MetaDataModel;
/**
* Get the metadata attached to the state class if it exists.
*
* @ignore
*/
export declare function getStoreMetadata(target: StateClassInternal): MetaDataModel;
/**
* Ensures metadata is attached to the selector and returns it.
*
* @ignore
*/
export declare function ensureSelectorMetadata(target: Function): SelectorMetaDataModel;
/**
* Get the metadata attached to the selector if it exists.
*
* @ignore
*/
export declare function getSelectorMetadata(target: any): SelectorMetaDataModel;
/**
* Get a deeply nested value. Example:

@@ -84,4 +31,7 @@ *

* @ignore
*
* Marked for removal. It's only used within `createSelectorFn`.
*/
export declare function propGetter(paths: string[], config: NgxsConfig): (x: any) => any;
export declare const ɵPROP_GETTER: InjectionToken<(paths: string[]) => (x: any) => any>;
/**

@@ -105,3 +55,3 @@ * Given an array of states, it will return a object graph. Example:

*/
export declare function buildGraph(stateClasses: StateClassInternal[]): StateKeyGraph;
export declare function buildGraph(stateClasses: ɵStateClassInternal[]): StateKeyGraph;
/**

@@ -117,3 +67,3 @@ * Given a states array, returns object graph

*/
export declare function nameToState(states: StateClassInternal[]): PlainObjectOf<StateClassInternal>;
export declare function nameToState(states: ɵStateClassInternal[]): ɵPlainObjectOf<ɵStateClassInternal>;
/**

@@ -139,3 +89,3 @@ * Given a object relationship graph will return the full path

*/
export declare function findFullParentPath(obj: StateKeyGraph, newObj?: PlainObjectOf<string>): PlainObjectOf<string>;
export declare function findFullParentPath(obj: StateKeyGraph, newObj?: ɵPlainObjectOf<string>): ɵPlainObjectOf<string>;
/**

@@ -161,7 +111,1 @@ * Given a object graph, it will return the items topologically sorted Example:

export declare function topologicalSort(graph: StateKeyGraph): string[];
/**
* Returns if the parameter is a object or not.
*
* @ignore
*/
export declare function isObject(obj: any): boolean;
import { OnDestroy } from '@angular/core';
import { NgxsBootstrapper } from '@ngxs/store/internals';
import { ɵNgxsAppBootstrappedState } from '@ngxs/store/internals';
import { InitState, UpdateState } from '@ngxs/store/plugins';
import { Store } from '../store';
import { InternalErrorReporter } from './error-handler';
import { StateContextFactory } from './state-context-factory';

@@ -11,10 +11,10 @@ import { InternalStateOperations } from './state-operations';

private _store;
private _internalErrorReporter;
private _internalStateOperations;
private _stateContextFactory;
private _bootstrapper;
private _appBootstrappedState;
private readonly _destroy$;
constructor(_store: Store, _internalErrorReporter: InternalErrorReporter, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory, _bootstrapper: NgxsBootstrapper);
private _initStateHasBeenDispatched?;
constructor(_store: Store, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory, _appBootstrappedState: ɵNgxsAppBootstrappedState);
ngOnDestroy(): void;
ngxsBootstrap<T>(action: T, results: StatesAndDefaults | undefined): void;
ngxsBootstrap(action: InitState | UpdateState, results: StatesAndDefaults | undefined): void;
private _invokeInitOnStates;

@@ -21,0 +21,0 @@ private _invokeBootstrapOnStates;

import { Injector, OnDestroy } from '@angular/core';
import { ɵStateClassInternal, ɵRuntimeSelectorContext } from '@ngxs/store/internals';
import { Observable } from 'rxjs';
import { NgxsConfig } from '../symbols';
import { MappedStore, StateClassInternal, StatesAndDefaults, StatesByName, RuntimeSelectorContext } from './internals';
import { MappedStore, StatesAndDefaults, StatesByName } from './internals';
import { ActionContext, InternalActions } from '../actions-stream';

@@ -31,2 +32,4 @@ import { InternalDispatchedActionResults } from '../internal/dispatcher';

private _actionsSubscription;
private _propGetter;
private _ngxsUnhandledErrorHandler;
constructor(_injector: Injector, _config: NgxsConfig, _parentFactory: StateFactory, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _stateContextFactory: StateContextFactory, _initialState: any);

@@ -39,4 +42,3 @@ private _states;

private get statePaths();
getRuntimeSelectorContext: () => RuntimeSelectorContext;
private static _cloneDefaults;
getRuntimeSelectorContext: () => ɵRuntimeSelectorContext;
ngOnDestroy(): void;

@@ -46,7 +48,7 @@ /**

*/
add(stateClasses: StateClassInternal[]): MappedStore[];
add(stateClasses: ɵStateClassInternal[]): MappedStore[];
/**
* Add a set of states to the store and return the defaults
*/
addAndReturnDefaults(stateClasses: StateClassInternal[]): StatesAndDefaults;
addAndReturnDefaults(stateClasses: ɵStateClassInternal[]): StatesAndDefaults;
connectActionHandlers(): void;

@@ -56,3 +58,3 @@ /**

*/
invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<unknown[]>;
invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<[any]>;
private addToStatesMap;

@@ -59,0 +61,0 @@ private addRuntimeInfoToMeta;

@@ -0,4 +1,4 @@

import { ɵStateStream } from '@ngxs/store/internals';
import { StateOperations, StatesAndDefaults } from '../internal/internals';
import { InternalDispatcher } from '../internal/dispatcher';
import { StateStream } from './state-stream';
import { NgxsConfig } from '../symbols';

@@ -13,3 +13,3 @@ import * as i0 from "@angular/core";

private _config;
constructor(_stateStream: StateStream, _dispatcher: InternalDispatcher, _config: NgxsConfig);
constructor(_stateStream: ɵStateStream, _dispatcher: InternalDispatcher, _config: NgxsConfig);
/**

@@ -16,0 +16,0 @@ * Returns the root state operators.

import { ModuleWithProviders } from '@angular/core';
import { StateClass } from '@ngxs/store/internals';
import { ɵStateClass } from '@ngxs/store/internals';
import { NgxsModuleOptions } from './symbols';

@@ -7,16 +7,5 @@ import { NgxsRootModule } from './modules/ngxs-root.module';

import * as i0 from "@angular/core";
/**
* Ngxs Module
*/
export declare class NgxsModule {
/**
* Root module factory
*/
static forRoot(states?: StateClass[], options?: NgxsModuleOptions): ModuleWithProviders<NgxsRootModule>;
/**
* Feature module factory
*/
static forFeature(states?: StateClass[]): ModuleWithProviders<NgxsFeatureModule>;
private static ngxsTokenProviders;
private static appBootstrapListenerFactory;
static forRoot(states?: ɵStateClass[], options?: NgxsModuleOptions): ModuleWithProviders<NgxsRootModule>;
static forFeature(states?: ɵStateClass[]): ModuleWithProviders<NgxsFeatureModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsModule, never>;

@@ -23,0 +12,0 @@ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsModule, never, never, never>;

@@ -1,17 +0,10 @@

import { Store } from '../store';
import { InternalStateOperations } from '../internal/state-operations';
import { StateFactory } from '../internal/state-factory';
import { LifecycleStateManager } from '../internal/lifecycle-state-manager';
import { StateClassInternal } from '../internal/internals';
import * as i0 from "@angular/core";
/**
* Feature module
* @ignore
*/
export declare class NgxsFeatureModule {
constructor(_store: Store, internalStateOperations: InternalStateOperations, factory: StateFactory, states: StateClassInternal<any, any>[][] | undefined, lifecycleStateManager: LifecycleStateManager);
private static flattenStates;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFeatureModule, [null, null, null, { optional: true; }, null]>;
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFeatureModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsFeatureModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<NgxsFeatureModule>;
}

@@ -1,17 +0,10 @@

import { StateFactory } from '../internal/state-factory';
import { InternalStateOperations } from '../internal/state-operations';
import { Store } from '../store';
import { SelectFactory } from '../decorators/select/select-factory';
import { StateClassInternal } from '../internal/internals';
import { LifecycleStateManager } from '../internal/lifecycle-state-manager';
import * as i0 from "@angular/core";
/**
* Root module
* @ignore
*/
export declare class NgxsRootModule {
constructor(factory: StateFactory, internalStateOperations: InternalStateOperations, _store: Store, _select: SelectFactory, states: StateClassInternal<any, any>[] | undefined, lifecycleStateManager: LifecycleStateManager);
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsRootModule, [null, null, null, null, { optional: true; }, null]>;
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsRootModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsRootModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<NgxsRootModule>;
}
import { OperatorFunction } from 'rxjs';
import { ActionType } from '../actions/symbols';
import { ActionContext } from '../actions-stream';
declare type TupleKeys<T extends any[]> = Exclude<keyof T, keyof []>;
type TupleKeys<T extends any[]> = Exclude<keyof T, keyof []>;
/**

@@ -11,3 +11,3 @@ * Given a POJO, returns the POJO type, given a class constructor object, returns the type of the class.

*/
declare type Constructed<T> = T extends new (...args: any[]) => infer U ? U : T;
type Constructed<T> = T extends new (...args: any[]) => infer U ? U : T;
export interface ActionCompletion<T = any, E = Error> {

@@ -56,3 +56,3 @@ action: T;

*/
export declare function ofActionErrored<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
export declare function ofActionErrored<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, ActionCompletion<Constructed<T[TupleKeys<T>]>>>;
export {};

@@ -1,5 +0,1 @@

export { NgxsModule } from './module';
export { NGXS_PLUGINS, NgxsPlugin, NgxsPluginFn, NgxsNextPluginFn } from './symbols';
export { StateStream } from './internal/state-stream';
export { getActionTypeFromInstance, setValue, getValue } from './utils/utils';
export { InitState, UpdateState } from './actions/actions';
export { InitState, UpdateState, getActionTypeFromInstance, setValue, getValue, NGXS_PLUGINS, NgxsPlugin, NgxsPluginFn, NgxsNextPluginFn } from '@ngxs/store/plugins';

@@ -1,2 +0,2 @@

import { NgxsPlugin, NgxsPluginFn } from './symbols';
import { NgxsPlugin, NgxsPluginFn } from '@ngxs/store/plugins';
import * as i0 from "@angular/core";

@@ -3,0 +3,0 @@ export declare class PluginManager {

export { NgxsRootModule as ɵNgxsRootModule } from './modules/ngxs-root.module';
export { NgxsFeatureModule as ɵNgxsFeatureModule } from './modules/ngxs-feature.module';
export * from './selectors/private_api';

@@ -8,14 +8,17 @@ export { NgxsModule } from './module';

export { Actions, ActionContext, ActionStatus } from './actions-stream';
export { getSelectorMetadata, getStoreMetadata, ensureStoreMetadata, ensureSelectorMetadata, } from './public_to_deprecate';
export { ofAction, ofActionDispatched, ofActionSuccessful, ofActionCanceled, ofActionErrored, ofActionCompleted, ActionCompletion, } from './operators/of-action';
export { StateContext, StateOperator, NgxsOnInit, NgxsAfterBootstrap, NgxsOnChanges, NgxsModuleOptions, NgxsSimpleChange, } from './symbols';
export { ofAction, ofActionDispatched, ofActionSuccessful, ofActionCanceled, ofActionErrored, ofActionCompleted, ActionCompletion } from './operators/of-action';
export { NgxsConfig, StateContext, StateOperator, NgxsOnInit, NgxsAfterBootstrap, NgxsOnChanges, NgxsModuleOptions, NgxsSimpleChange } from './symbols';
export { Selector } from './decorators/selector/selector';
export { getActionTypeFromInstance, actionMatcher } from './utils/utils';
export { NgxsExecutionStrategy } from './execution/symbols';
export { ActionType, ActionOptions } from './actions/symbols';
export { ActionType, ActionDef } from './actions/symbols';
export { NoopNgxsExecutionStrategy } from './execution/noop-ngxs-execution-strategy';
export { StateToken } from './state-token/state-token';
export { NgxsUnhandledErrorHandler, NgxsUnhandledErrorContext } from './ngxs-unhandled-error-handler';
export { NgxsDevelopmentOptions } from './dev-features/symbols';
export { NgxsDevelopmentModule } from './dev-features/ngxs-development.module';
export { NgxsDevelopmentModule, withNgxsDevelopmentOptions } from './dev-features/ngxs-development.module';
export { NgxsUnhandledActionsLogger } from './dev-features/ngxs-unhandled-actions-logger';
export { createModelSelector, createPickSelector, createPropertySelectors, createSelector, PropertySelectors, TypedSelector, } from './selectors';
export { createModelSelector, createPickSelector, createPropertySelectors, createSelector, PropertySelectors, TypedSelector } from './selectors';
export * from './standalone-features';
export * from './utils/public_api';
export { StateToken } from '@ngxs/store/internals';
export { ɵActionOptions as ActionOptions } from '@ngxs/store/internals';
export { getActionTypeFromInstance, actionMatcher } from '@ngxs/store/plugins';

@@ -5,4 +5,4 @@ import { TypedSelector } from './selector-types.util';

}
declare type ModelSelector<T extends SelectorMap> = (...args: any[]) => MappedResult<T>;
declare type MappedResult<TSelectorMap> = {
type ModelSelector<T extends SelectorMap> = (...args: any[]) => MappedResult<T>;
type MappedResult<TSelectorMap> = {
[P in keyof TSelectorMap]: TSelectorMap[P] extends TypedSelector<infer R> ? R : never;

@@ -9,0 +9,0 @@ };

import { TypedSelector } from './selector-types.util';
declare type KeysToValues<T, Keys extends (keyof T)[]> = {
type KeysToValues<T, Keys extends (keyof T)[]> = {
[Index in keyof Keys]: Keys[Index] extends keyof T ? T[Keys[Index]] : never;

@@ -4,0 +4,0 @@ };

@@ -1,5 +0,5 @@

import { SelectorDef } from './selector-types.util';
export declare type PropertySelectors<TModel> = {
import { ɵSelectorDef } from './selector-types.util';
export type PropertySelectors<TModel> = {
[P in keyof NonNullable<TModel>]-?: (model: TModel) => TModel extends null | undefined ? undefined : NonNullable<TModel>[P];
};
export declare function createPropertySelectors<TModel>(parentSelector: SelectorDef<TModel>): PropertySelectors<TModel>;
export declare function createPropertySelectors<TModel>(parentSelector: ɵSelectorDef<TModel>): PropertySelectors<TModel>;
import { CreationMetadata } from './selector-models';
import { SelectorDef, SelectorReturnType } from './selector-types.util';
declare type SelectorArg = SelectorDef<any>;
import { ɵSelectorDef, ɵSelectorReturnType } from './selector-types.util';
type SelectorArg = ɵSelectorDef<any>;
/**

@@ -10,11 +10,11 @@ * Function for creating a selector

*/
export declare function createSelector<S1 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>) => any>(selectors: [S1], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>) => any>(selectors: [S1, S2], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>) => any>(selectors: [S1, S2, S3], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>) => any>(selectors: [S1, S2, S3, S4], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>) => any>(selectors: [S1, S2, S3, S4, S5], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>) => any>(selectors: [S1, S2, S3, S4, S5, S6], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>, s7: SelectorReturnType<S7>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, S8 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>, s7: SelectorReturnType<S7>, s8: SelectorReturnType<S8>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7, S8], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>) => any>(selectors: [S1], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>) => any>(selectors: [S1, S2], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>) => any>(selectors: [S1, S2, S3], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>) => any>(selectors: [S1, S2, S3, S4], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>) => any>(selectors: [S1, S2, S3, S4, S5], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>) => any>(selectors: [S1, S2, S3, S4, S5, S6], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>, s7: ɵSelectorReturnType<S7>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, S8 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>, s7: ɵSelectorReturnType<S7>, s8: ɵSelectorReturnType<S8>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7, S8], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
export declare function createSelector<T extends (...args: any[]) => any>(selectors: SelectorArg[] | undefined, projector: T, creationMetadata?: Partial<CreationMetadata>): T;
export {};

@@ -1,3 +0,3 @@

import { SelectorDef } from './selector-types.util';
export declare function ensureValidSelector(selector: SelectorDef<any>, context?: {
import { ɵSelectorDef } from './selector-types.util';
export declare function ensureValidSelector(selector: ɵSelectorDef<any>, context?: {
prefix?: string;

@@ -4,0 +4,0 @@ noun?: string;

@@ -1,7 +0,7 @@

import { SelectorMetaDataModel, SharedSelectorOptions } from '../internal/internals';
import { ɵSelectorMetaDataModel, ɵSharedSelectorOptions } from '@ngxs/store/internals';
import { CreationMetadata } from './selector-models';
export declare const selectorOptionsMetaAccessor: {
getOptions: (target: any) => SharedSelectorOptions;
defineOptions: (target: any, options: SharedSelectorOptions) => void;
getOptions: (target: any) => ɵSharedSelectorOptions;
defineOptions: (target: any, options: ɵSharedSelectorOptions) => void;
};
export declare function setupSelectorMetadata<T extends (...args: any[]) => any>(originalFn: T, creationMetadata: Partial<CreationMetadata> | undefined): SelectorMetaDataModel;
export declare function setupSelectorMetadata<T extends (...args: any[]) => any>(originalFn: T, creationMetadata: Partial<CreationMetadata> | undefined): ɵSelectorMetaDataModel;

@@ -1,10 +0,10 @@

import { SharedSelectorOptions, SelectFromRootState } from '../internal/internals';
import { ɵSharedSelectorOptions, ɵSelectFromRootState } from '@ngxs/store/internals';
export interface CreationMetadata {
containerClass: any;
selectorName: string;
getSelectorOptions?: () => SharedSelectorOptions;
getSelectorOptions?: () => ɵSharedSelectorOptions;
}
export interface RuntimeSelectorInfo {
selectorOptions: SharedSelectorOptions;
argumentSelectorFunctions: SelectFromRootState[];
selectorOptions: ɵSharedSelectorOptions;
argumentSelectorFunctions: ɵSelectFromRootState[];
}

@@ -1,7 +0,6 @@

import { StateClass } from '@ngxs/store/internals';
import { StateToken } from '../state-token/state-token';
export declare type SelectorFunc<TModel> = (...arg: any[]) => TModel;
export declare type TypedSelector<TModel> = StateToken<TModel> | SelectorFunc<TModel>;
export declare type StateSelector = StateClass<any>;
export declare type SelectorDef<TModel> = StateSelector | TypedSelector<TModel>;
export declare type SelectorReturnType<T extends SelectorDef<any>> = T extends StateToken<infer R1> ? R1 : T extends SelectorFunc<infer R2> ? R2 : T extends StateClass<any> ? any : never;
import { ɵStateClass, StateToken } from '@ngxs/store/internals';
export type ɵSelectorFunc<TModel> = (...arg: any[]) => TModel;
export type TypedSelector<TModel> = StateToken<TModel> | ɵSelectorFunc<TModel>;
export type ɵStateSelector = ɵStateClass<any>;
export type ɵSelectorDef<TModel> = ɵStateSelector | TypedSelector<TModel>;
export type ɵSelectorReturnType<T extends ɵSelectorDef<any>> = T extends StateToken<infer R1> ? R1 : T extends ɵSelectorFunc<infer R2> ? R2 : T extends ɵStateClass<any> ? any : never;

@@ -1,4 +0,4 @@

import { SelectorMetaDataModel, SelectorFactory } from '../internal/internals';
import { ɵSelectorFactory, ɵSelectorMetaDataModel } from '@ngxs/store/internals';
import { CreationMetadata } from './selector-models';
export declare function createRootSelectorFactory<T extends (...args: any[]) => any>(selectorMetaData: SelectorMetaDataModel, selectors: any[] | undefined, memoizedSelectorFn: T): SelectorFactory;
export declare function createRootSelectorFactory<T extends (...args: any[]) => any>(selectorMetaData: ɵSelectorMetaDataModel, selectors: any[] | undefined, memoizedSelectorFn: T): ɵSelectorFactory;
export declare function createMemoizedSelectorFn<T extends (...args: any[]) => any>(originalFn: T, creationMetadata: Partial<CreationMetadata> | undefined): T;

@@ -9,2 +9,2 @@ /**

*/
export declare function getRootSelectorFactory(selector: any): SelectorFactory;
export declare function getRootSelectorFactory(selector: any): ɵSelectorFactory;

@@ -1,9 +0,9 @@

import { Type } from '@angular/core';
import { Signal } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { ɵStateStream } from '@ngxs/store/internals';
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
import { InternalStateOperations } from './internal/state-operations';
import { StateStream } from './internal/state-stream';
import { NgxsConfig } from './symbols';
import { StateToken } from './state-token/state-token';
import { StateFactory } from './internal/state-factory';
import { TypedSelector } from './selectors';
import * as i0 from "@angular/core";

@@ -22,26 +22,25 @@ export declare class Store {

private _selectableStateStream;
constructor(_stateStream: StateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
constructor(_stateStream: ɵStateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
/**
* Dispatches event(s).
*/
dispatch(actionOrActions: any | any[]): Observable<any>;
dispatch(actionOrActions: any | any[]): Observable<void>;
/**
* Selects a slice of data from the store.
*/
select<T>(selector: (state: any, ...states: any[]) => T): Observable<T>;
select<T = any>(selector: string | Type<any>): Observable<T>;
select<T>(selector: StateToken<T>): Observable<T>;
select<T>(selector: TypedSelector<T>): Observable<T>;
/**
* Select one slice of data from the store.
*/
selectOnce<T>(selector: (state: any, ...states: any[]) => T): Observable<T>;
selectOnce<T = any>(selector: string | Type<any>): Observable<T>;
selectOnce<T>(selector: StateToken<T>): Observable<T>;
selectOnce<T>(selector: TypedSelector<T>): Observable<T>;
/**
* Select a snapshot from the state.
*/
selectSnapshot<T>(selector: (state: any, ...states: any[]) => T): T;
selectSnapshot<T = any>(selector: string | Type<any>): T;
selectSnapshot<T>(selector: StateToken<T>): T;
selectSnapshot<T>(selector: TypedSelector<T>): T;
/**
* Select a signal from the state.
*/
selectSignal<T>(selector: TypedSelector<T>): Signal<T>;
private selectFromStateStream;
/**
* Allow the user to subscribe to the root of the state

@@ -58,3 +57,3 @@ */

*/
reset(state: any): any;
reset(state: any): void;
private getStoreBoundSelectorFn;

@@ -61,0 +60,0 @@ private initStateStream;

import { InjectionToken, Type } from '@angular/core';
import { Observable } from 'rxjs';
import { PlainObject, StateClass } from '@ngxs/store/internals';
import { StateOperator } from '@ngxs/store/operators';
import { ɵSharedSelectorOptions, ɵStateClass } from '@ngxs/store/internals';
import { NgxsExecutionStrategy } from './execution/symbols';
import { SharedSelectorOptions } from './internal/internals';
import { StateToken } from './state-token/state-token';
import * as i0 from "@angular/core";
export declare const ROOT_OPTIONS: InjectionToken<Partial<NgxsConfig>>;
export declare const ROOT_STATE_TOKEN: InjectionToken<any>;
export declare const FEATURE_STATE_TOKEN: InjectionToken<any>;
export declare const NGXS_PLUGINS: InjectionToken<unknown>;
export declare const META_KEY = "NGXS_META";
export declare const META_OPTIONS_KEY = "NGXS_OPTIONS_META";
export declare const SELECTOR_META_KEY = "NGXS_SELECTOR_META";
export declare type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
export declare type NgxsPluginFn = (state: any, mutation: any, next: NgxsNextPluginFn) => any;
export declare const ROOT_STATE_TOKEN: InjectionToken<ɵStateClass[]>;
export declare const FEATURE_STATE_TOKEN: InjectionToken<ɵStateClass[][]>;
export declare const NGXS_OPTIONS: InjectionToken<Partial<NgxsConfig>>;
export type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
/**

@@ -27,5 +20,5 @@ * The NGXS config settings.

*
* Note: this property will be accounted only in development mode when using the Ivy compiler.
* Note: this property will be accounted only in development mode.
* It makes sense to use it only during development to ensure there're no state mutations.
* When building for production, the Object.freeze will be tree-shaken away.
* When building for production, the `Object.freeze` will be tree-shaken away.
*/

@@ -46,3 +39,3 @@ developmentMode: boolean;

* These observable behaviours are from:
* `@Select(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)`
* `store.selectSignal(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)`
* Every `zone.run` causes Angular to run change detection on the whole tree (`app.tick()`) so of your

@@ -55,13 +48,5 @@ * application doesn't rely on zone.js running change detection then you can switch to the

/**
* Defining the default state before module initialization
* This is convenient if we need to create a define our own set of states.
* @deprecated will be removed after v4
* (default: {})
*/
defaultsState: PlainObject;
/**
* Defining shared selector options
*/
selectorOptions: SharedSelectorOptions;
constructor();
selectorOptions: ɵSharedSelectorOptions;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsConfig, never>;

@@ -82,7 +67,7 @@ static ɵprov: i0.ɵɵInjectableDeclaration<NgxsConfig>;

*/
setState(val: T | StateOperator<T>): T;
setState(val: T | StateOperator<T>): void;
/**
* Patch the existing state with the provided value.
*/
patchState(val: Partial<T>): T;
patchState(val: Partial<T>): void;
/**

@@ -93,30 +78,3 @@ * Dispatch a new action and return the dispatched observable.

}
export declare type NgxsNextPluginFn = (state: any, mutation: any) => any;
/**
* Plugin interface
*/
export interface NgxsPlugin {
/**
* Handle the state/action before its submitted to the state handlers.
*/
handle(state: any, action: any, next: NgxsNextPluginFn): any;
}
/**
* Options that can be provided to the store.
*/
export interface StoreOptions<T> {
/**
* Name of the state. Required.
*/
name: string | StateToken<T>;
/**
* Default values for the state. If not provided, uses empty object.
*/
defaults?: T;
/**
* Sub states for the given state.
*/
children?: StateClass[];
}
/**
* Represents a basic change from a previous to a new value for a single state instance.

@@ -149,2 +107,2 @@ * Passed as a value in a NgxsSimpleChanges object to the ngxsOnChanges hook.

}
export declare type NgxsModuleOptions = Partial<NgxsConfig>;
export type NgxsModuleOptions = Partial<NgxsConfig>;

@@ -1,2 +0,2 @@

export declare type StateFn = (...args: any[]) => any;
export type StateFn = (...args: any[]) => any;
/**

@@ -3,0 +3,0 @@ * Composes a array of functions from left to right. Example:

@@ -1,4 +0,5 @@

import { StateClassInternal, StatesByName } from '../internal/internals';
import { ɵStateClassInternal } from '@ngxs/store/internals';
import { StatesByName } from '../internal/internals';
export declare function ensureStateNameIsValid(name: string | null): void | never;
export declare function ensureStateNameIsUnique(stateName: string, state: StateClassInternal, statesByName: StatesByName): void | never;
export declare function ensureStatesAreDecorated(stateClasses: StateClassInternal[]): void | never;
export declare function ensureStateNameIsUnique(stateName: string, state: ɵStateClassInternal, statesByName: StatesByName): void | never;
export declare function ensureStatesAreDecorated(stateClasses: ɵStateClassInternal[]): void | never;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc