@ember-data/store 5.4.0-beta.4 → 5.4.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/addon-main.cjs +5 -0
- package/dist/-private.js +1 -0
- package/{addon/cache-handler-XLbbNJdo.js → dist/cache-handler-C5ilAUZ5.js} +1140 -657
- package/dist/cache-handler-C5ilAUZ5.js.map +1 -0
- package/{addon → dist}/index.js +4 -1
- package/{addon → dist}/index.js.map +1 -1
- package/dist/types.js +0 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -51
- package/unstable-preview-types/-private/cache-handler.d.ts +144 -0
- package/unstable-preview-types/-private/cache-handler.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
- package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +176 -0
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -0
- package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
- package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/document.d.ts +146 -0
- package/unstable-preview-types/-private/document.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +441 -0
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +96 -0
- package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -0
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
- package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
- package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +138 -0
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
- package/unstable-preview-types/-private/store-service.d.ts +1522 -0
- package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
- package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
- package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
- package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +25 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/-types/overview.d.ts +21 -0
- package/unstable-preview-types/-types/overview.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +109 -0
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
- package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
- package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
- package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
- package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/schema-service.d.ts +358 -0
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
- package/unstable-preview-types/-types/q/store.d.ts +38 -0
- package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +222 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/types.d.ts +7 -0
- package/unstable-preview-types/types.d.ts.map +1 -0
- package/addon/-private.js +0 -1
- package/addon/cache-handler-XLbbNJdo.js.map +0 -1
- package/addon-main.js +0 -93
- /package/{addon → dist}/-private.js.map +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/network/request-cache' {
|
|
2
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
+
import type { FindRecordOptions } from '@ember-data/store/-types/q/store';
|
|
4
|
+
import type { Store } from '@ember-data/store/-private/store-service';
|
|
5
|
+
const Touching: "___(unique) Symbol(Touching)";
|
|
6
|
+
export const RequestPromise: "___(unique) Symbol(RequestPromise)";
|
|
7
|
+
export interface Operation {
|
|
8
|
+
op: string;
|
|
9
|
+
options: FindRecordOptions | undefined;
|
|
10
|
+
recordIdentifier: StableRecordIdentifier;
|
|
11
|
+
}
|
|
12
|
+
export interface FindRecordQuery extends Operation {
|
|
13
|
+
op: 'findRecord';
|
|
14
|
+
}
|
|
15
|
+
export interface SaveRecordMutation extends Operation {
|
|
16
|
+
op: 'saveRecord';
|
|
17
|
+
}
|
|
18
|
+
export interface Request {
|
|
19
|
+
data: Operation[];
|
|
20
|
+
options?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export type RequestStates = 'pending' | 'fulfilled' | 'rejected';
|
|
23
|
+
export interface RequestState {
|
|
24
|
+
state: RequestStates;
|
|
25
|
+
type: 'query' | 'mutation';
|
|
26
|
+
request: Request;
|
|
27
|
+
response?: Response;
|
|
28
|
+
}
|
|
29
|
+
export interface Response {
|
|
30
|
+
data: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface InternalRequest extends RequestState {
|
|
33
|
+
[Touching]: StableRecordIdentifier[];
|
|
34
|
+
[RequestPromise]?: Promise<unknown>;
|
|
35
|
+
}
|
|
36
|
+
export type RequestSubscription = (requestState: RequestState) => void;
|
|
37
|
+
/**
|
|
38
|
+
* The RequestStateService is used to track the state of requests
|
|
39
|
+
* for fetching or updating known resource identifies that are inflight.
|
|
40
|
+
*
|
|
41
|
+
* @class RequestStateService
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export class RequestStateService {
|
|
45
|
+
_pending: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
46
|
+
_done: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
47
|
+
_subscriptions: Map<StableRecordIdentifier, RequestSubscription[]>;
|
|
48
|
+
_toFlush: InternalRequest[];
|
|
49
|
+
_store: Store;
|
|
50
|
+
constructor(store: Store);
|
|
51
|
+
_clearEntries(identifier: StableRecordIdentifier): void;
|
|
52
|
+
_enqueue<T>(promise: Promise<T>, queryRequest: Request): Promise<T>;
|
|
53
|
+
_triggerSubscriptions(req: InternalRequest): void;
|
|
54
|
+
_flush(): void;
|
|
55
|
+
_flushRequest(req: InternalRequest): void;
|
|
56
|
+
_dequeue(identifier: StableRecordIdentifier, request: InternalRequest): void;
|
|
57
|
+
_addDone(request: InternalRequest): void;
|
|
58
|
+
/**
|
|
59
|
+
* Subscribe to requests for a given resource identity.
|
|
60
|
+
*
|
|
61
|
+
* The callback will receive the current state of the request.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* interface RequestState {
|
|
65
|
+
* state: 'pending' | 'fulfilled' | 'rejected';
|
|
66
|
+
* type: 'query' | 'mutation';
|
|
67
|
+
* request: Request;
|
|
68
|
+
* response?: { data: unknown };
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* Note: It should be considered dangerous to use this API for more than simple
|
|
73
|
+
* state derivation or debugging. The `request` and `response` properties are poorly
|
|
74
|
+
* spec'd and may change unexpectedly when shifting what Handlers are in use or how
|
|
75
|
+
* requests are issued from the Store.
|
|
76
|
+
*
|
|
77
|
+
* We expect to revisit this API in the near future as we continue to refine the
|
|
78
|
+
* RequestManager ergonomics, as a simpler but more powerful direct integration
|
|
79
|
+
* with the RequestManager for these purposes is likely to be a better long-term
|
|
80
|
+
* design.
|
|
81
|
+
*
|
|
82
|
+
* @method subscribeForRecord
|
|
83
|
+
* @public
|
|
84
|
+
* @param {StableRecordIdentifier} identifier
|
|
85
|
+
* @param {(state: RequestState) => void} callback
|
|
86
|
+
*/
|
|
87
|
+
subscribeForRecord(identifier: StableRecordIdentifier, callback: RequestSubscription): void;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve all active requests for a given resource identity.
|
|
90
|
+
*
|
|
91
|
+
* @method getPendingRequestsForRecord
|
|
92
|
+
* @public
|
|
93
|
+
* @param {StableRecordIdentifier} identifier
|
|
94
|
+
* @return {RequestState[]} an array of request states for any pending requests for the given identifier
|
|
95
|
+
*/
|
|
96
|
+
getPendingRequestsForRecord(identifier: StableRecordIdentifier): RequestState[];
|
|
97
|
+
/**
|
|
98
|
+
* Retrieve the last completed request for a given resource identity.
|
|
99
|
+
*
|
|
100
|
+
* @method getLastRequestForRecord
|
|
101
|
+
* @public
|
|
102
|
+
* @param {StableRecordIdentifier} identifier
|
|
103
|
+
* @return {RequestState | null} the state of the most recent request for the given identifier
|
|
104
|
+
*/
|
|
105
|
+
getLastRequestForRecord(identifier: StableRecordIdentifier): RequestState | null;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=request-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/network/request-cache.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAA,MAAM,QAAQ,gCAAiD,CAAC;AAChE,eAAO,MAAM,cAAc,sCAAsD,CAAC;AAGlF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACvC,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,O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,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,YAAY,EAAE;IAI/E;;;;;;;OAOG;IACH,uBAAuB,CAAC,UAAU,EAAE,sBAAsB,GAAG,YAAY,GAAG,IAAI;CAOjF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/record-arrays/identifier-array' {
|
|
2
|
+
import type { Signal } from '@ember-data/tracking/-private';
|
|
3
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
4
|
+
import type { TypeFromInstanceOrString } from '@warp-drive/core-types/record';
|
|
5
|
+
import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
|
|
6
|
+
import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
|
|
7
|
+
import type { RecordArrayManager } from '@ember-data/store/-private/managers/record-array-manager';
|
|
8
|
+
import type { Store } from '@ember-data/store/-private/store-service';
|
|
9
|
+
import { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
|
|
10
|
+
export const ARRAY_SIGNAL: "___(unique) Symbol(#signal)";
|
|
11
|
+
export const SOURCE: "___(unique) Symbol(#source)";
|
|
12
|
+
export const MUTATE: "___(unique) Symbol(#update)";
|
|
13
|
+
export const NOTIFY: "___(unique) Symbol(#notify)";
|
|
14
|
+
const IS_COLLECTION: "___(unique) Symbol(IS_COLLECTION)";
|
|
15
|
+
export function notifyArray(arr: IdentifierArray): void;
|
|
16
|
+
export type IdentifierArrayCreateOptions<T = unknown> = {
|
|
17
|
+
identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
|
|
18
|
+
type?: TypeFromInstanceOrString<T>;
|
|
19
|
+
store: Store;
|
|
20
|
+
allowMutation: boolean;
|
|
21
|
+
manager: MinimumManager;
|
|
22
|
+
links?: Links | PaginationLinks | null;
|
|
23
|
+
meta?: Record<string, unknown> | null;
|
|
24
|
+
};
|
|
25
|
+
type MinimumManager = {
|
|
26
|
+
_syncArray: (array: IdentifierArray) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
A record array is an array that contains records of a certain type (or modelName).
|
|
30
|
+
The record array materializes records as needed when they are retrieved for the first
|
|
31
|
+
time. You should not create record arrays yourself. Instead, an instance of
|
|
32
|
+
`RecordArray` or its subclasses will be returned by your application's store
|
|
33
|
+
in response to queries.
|
|
34
|
+
|
|
35
|
+
This class should not be imported and instantiated by consuming applications.
|
|
36
|
+
|
|
37
|
+
@class RecordArray
|
|
38
|
+
@public
|
|
39
|
+
*/
|
|
40
|
+
export interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
|
|
41
|
+
[MUTATE]?(target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
42
|
+
}
|
|
43
|
+
export class IdentifierArray<T = unknown> {
|
|
44
|
+
DEPRECATED_CLASS_NAME: string;
|
|
45
|
+
/**
|
|
46
|
+
The flag to signal a `RecordArray` is currently loading data.
|
|
47
|
+
Example
|
|
48
|
+
```javascript
|
|
49
|
+
let people = store.peekAll('person');
|
|
50
|
+
people.isUpdating; // false
|
|
51
|
+
people.update();
|
|
52
|
+
people.isUpdating; // true
|
|
53
|
+
```
|
|
54
|
+
@property isUpdating
|
|
55
|
+
@public
|
|
56
|
+
@type Boolean
|
|
57
|
+
*/
|
|
58
|
+
isUpdating: boolean;
|
|
59
|
+
isLoaded: boolean;
|
|
60
|
+
isDestroying: boolean;
|
|
61
|
+
isDestroyed: boolean;
|
|
62
|
+
_updatingPromise: Promise<IdentifierArray<T>> | null;
|
|
63
|
+
[IS_COLLECTION]: boolean;
|
|
64
|
+
[ARRAY_SIGNAL]: Signal;
|
|
65
|
+
[SOURCE]: StableRecordIdentifier[];
|
|
66
|
+
[NOTIFY](): void;
|
|
67
|
+
links: Links | PaginationLinks | null;
|
|
68
|
+
meta: Record<string, unknown> | null;
|
|
69
|
+
modelName?: TypeFromInstanceOrString<T>;
|
|
70
|
+
/**
|
|
71
|
+
The store that created this record array.
|
|
72
|
+
|
|
73
|
+
@property store
|
|
74
|
+
@private
|
|
75
|
+
@type Store
|
|
76
|
+
*/
|
|
77
|
+
store: Store;
|
|
78
|
+
_manager: MinimumManager;
|
|
79
|
+
destroy(clear: boolean): void;
|
|
80
|
+
get length(): number;
|
|
81
|
+
set length(value: number);
|
|
82
|
+
constructor(options: IdentifierArrayCreateOptions<T>);
|
|
83
|
+
/**
|
|
84
|
+
Used to get the latest version of all of the records in this array
|
|
85
|
+
from the adapter.
|
|
86
|
+
|
|
87
|
+
Example
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
let people = store.peekAll('person');
|
|
91
|
+
people.isUpdating; // false
|
|
92
|
+
|
|
93
|
+
people.update().then(function() {
|
|
94
|
+
people.isUpdating; // false
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
people.isUpdating; // true
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
@method update
|
|
101
|
+
@public
|
|
102
|
+
*/
|
|
103
|
+
update(): Promise<IdentifierArray<T>>;
|
|
104
|
+
_update(): Promise<IdentifierArray<T>>;
|
|
105
|
+
/**
|
|
106
|
+
Saves all of the records in the `RecordArray`.
|
|
107
|
+
|
|
108
|
+
Example
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
let messages = store.peekAll('message');
|
|
112
|
+
messages.forEach(function(message) {
|
|
113
|
+
message.hasBeenSeen = true;
|
|
114
|
+
});
|
|
115
|
+
messages.save();
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
@method save
|
|
119
|
+
@public
|
|
120
|
+
@return {Promise<IdentifierArray>} promise
|
|
121
|
+
*/
|
|
122
|
+
save(): Promise<IdentifierArray>;
|
|
123
|
+
}
|
|
124
|
+
export type CollectionCreateOptions = IdentifierArrayCreateOptions & {
|
|
125
|
+
manager: RecordArrayManager;
|
|
126
|
+
query: ImmutableRequestInfo | Record<string, unknown> | null;
|
|
127
|
+
isLoaded: boolean;
|
|
128
|
+
};
|
|
129
|
+
export class Collection<T = unknown> extends IdentifierArray<T> {
|
|
130
|
+
query: ImmutableRequestInfo | Record<string, unknown> | null;
|
|
131
|
+
_manager: RecordArrayManager;
|
|
132
|
+
constructor(options: CollectionCreateOptions);
|
|
133
|
+
_update(): Promise<Collection<T>>;
|
|
134
|
+
destroy(clear: boolean): void;
|
|
135
|
+
}
|
|
136
|
+
export {};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=identifier-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier-array.d.ts","sourceRoot":"","sources":["../../../src/-private/record-arrays/identifier-array.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAU5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAKvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAuCtD,eAAO,MAAM,YAAY,+BAA+C,CAAC;AACzE,eAAO,MAAM,MAAM,+BAA+C,CAAC;AACnE,eAAO,MAAM,MAAM,+BAA+C,CAAC;AACnE,eAAO,MAAM,MAAM,+BAA+C,CAAC;AACnE,QAAA,MAAM,aAAa,qCAA4D,CAAC;AAEhF,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,QAE/C;AAcD,MAAM,MAAM,4BAA4B,CAAC,CAAC,GAAG,OAAO,IAAI;IACtD,WAAW,E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,0 +1,118 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/record-arrays/native-proxy-type-fix' {
|
|
2
|
+
interface ProxyHandler<T extends object> {
|
|
3
|
+
/**
|
|
4
|
+
* A trap method for a function call.
|
|
5
|
+
* @param target The original callable object which is being proxied.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
apply?(target: T, thisArg: any, argArray: any[]): any;
|
|
9
|
+
/**
|
|
10
|
+
* A trap for the `new` operator.
|
|
11
|
+
* @param target The original object which is being proxied.
|
|
12
|
+
* @param newTarget The constructor that was originally called.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
construct?(target: T, argArray: any[], newTarget: Function): object;
|
|
16
|
+
/**
|
|
17
|
+
* A trap for `Object.defineProperty()`.
|
|
18
|
+
* @param target The original object which is being proxied.
|
|
19
|
+
* @returns A `Boolean` indicating whether or not the property has been defined.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A trap for the `delete` operator.
|
|
25
|
+
* @param target The original object which is being proxied.
|
|
26
|
+
* @param p The name or `Symbol` of the property to delete.
|
|
27
|
+
* @returns A `Boolean` indicating whether or not the property was deleted.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
deleteProperty?(target: T, p: string | symbol): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A trap for getting a property value.
|
|
33
|
+
* @param target The original object which is being proxied.
|
|
34
|
+
* @param p The name or `Symbol` of the property to get.
|
|
35
|
+
* @param receiver The proxy or an object that inherits from the proxy.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
get?(target: T, p: string | symbol, receiver: any): any;
|
|
39
|
+
/**
|
|
40
|
+
* A trap for `Object.getOwnPropertyDescriptor()`.
|
|
41
|
+
* @param target The original object which is being proxied.
|
|
42
|
+
* @param p The name of the property whose description should be retrieved.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* A trap for the `[[GetPrototypeOf]]` internal method.
|
|
48
|
+
* @param target The original object which is being proxied.
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
getPrototypeOf?(target: T): object | null;
|
|
52
|
+
/**
|
|
53
|
+
* A trap for the `in` operator.
|
|
54
|
+
* @param target The original object which is being proxied.
|
|
55
|
+
* @param p The name or `Symbol` of the property to check for existence.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
has?(target: T, p: string | symbol): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A trap for `Object.isExtensible()`.
|
|
61
|
+
* @param target The original object which is being proxied.
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
isExtensible?(target: T): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A trap for `Reflect.ownKeys()`.
|
|
67
|
+
* @param target The original object which is being proxied.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
ownKeys?(target: T): ArrayLike<string | symbol>;
|
|
71
|
+
/**
|
|
72
|
+
* A trap for `Object.preventExtensions()`.
|
|
73
|
+
* @param target The original object which is being proxied.
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
preventExtensions?(target: T): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* A trap for setting a property value.
|
|
79
|
+
* @param target The original object which is being proxied.
|
|
80
|
+
* @param p The name or `Symbol` of the property to set.
|
|
81
|
+
* @param receiver The object to which the assignment was originally directed.
|
|
82
|
+
* @returns A `Boolean` indicating whether or not the property was set.
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* A trap for `Object.setPrototypeOf()`.
|
|
88
|
+
* @param target The original object which is being proxied.
|
|
89
|
+
* @param newPrototype The object's new prototype or `null`.
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
setPrototypeOf?(target: T, v: object | null): boolean;
|
|
93
|
+
}
|
|
94
|
+
interface ProxyConstructor {
|
|
95
|
+
/**
|
|
96
|
+
* Creates a revocable Proxy object.
|
|
97
|
+
* @param target A target object to wrap with Proxy.
|
|
98
|
+
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
revocable<T extends object>(target: T, handler: ProxyHandler<T>): {
|
|
102
|
+
proxy: T;
|
|
103
|
+
revoke: () => void;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
|
|
107
|
+
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
|
|
108
|
+
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
|
|
109
|
+
* @param target A target object to wrap with Proxy.
|
|
110
|
+
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
new <TSource extends object, TTarget extends object>(target: TSource, handler: ProxyHandler<TSource>): TTarget;
|
|
114
|
+
}
|
|
115
|
+
export const NativeProxy: ProxyConstructor;
|
|
116
|
+
export {};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=native-proxy-type-fix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-proxy-type-fix.d.ts","sourceRoot":"","sources":["../../../src/-private/record-arrays/native-proxy-type-fix.ts"],"names":[],"mappings":"AAOA,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM;IACrC;;;;OAIG;IACH,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAEtD;;;;;O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