@@ -22,13 +22,13 @@ import { UNINITIALIZED } from '../../constants.js';
22
22
* @param {T } value
23
23
* @param {boolean } [immutable]
24
24
* @param {Set<Function> | null } [owners]
25
- * @returns {import('./types.js ').ProxyStateObject<T> | T }
25
+ * @returns {import('#client ').ProxyStateObject<T> | T }
26
26
*/
27
27
export function proxy ( value , immutable = true , owners ) {
28
28
if ( typeof value === 'object' && value != null && ! is_frozen ( value ) ) {
29
29
// If we have an existing proxy, return it...
30
30
if ( STATE_SYMBOL in value ) {
31
- const metadata = /** @type {import('./types.js ').ProxyMetadata<T> } */ ( value [ STATE_SYMBOL ] ) ;
31
+ const metadata = /** @type {import('#client ').ProxyMetadata<T> } */ ( value [ STATE_SYMBOL ] ) ;
32
32
// ...unless the proxy belonged to a different object, because
33
33
// someone copied the state symbol using `Reflect.ownKeys(...)`
34
34
if ( metadata . t === value || metadata . p === value ) {
@@ -53,7 +53,7 @@ export function proxy(value, immutable = true, owners) {
53
53
const proxy = new Proxy ( value , state_proxy_handler ) ;
54
54
55
55
define_property ( value , STATE_SYMBOL , {
56
- value : /** @type {import('./types.js ').ProxyMetadata } */ ( {
56
+ value : /** @type {import('#client ').ProxyMetadata } */ ( {
57
57
s : new Map ( ) ,
58
58
v : source ( 0 ) ,
59
59
a : is_array ( value ) ,
@@ -86,7 +86,7 @@ export function proxy(value, immutable = true, owners) {
86
86
}
87
87
88
88
/**
89
- * @template {import('./types.js ').ProxyStateObject} T
89
+ * @template {import('#client ').ProxyStateObject} T
90
90
* @param {T } value
91
91
* @param {Map<T, Record<string | symbol, any>> } already_unwrapped
92
92
* @returns {Record<string | symbol, any> }
@@ -138,23 +138,23 @@ function unwrap(value, already_unwrapped) {
138
138
*/
139
139
export function unstate ( value ) {
140
140
return /** @type {T } */ (
141
- unwrap ( /** @type {import('./types.js ').ProxyStateObject } */ ( value ) , new Map ( ) )
141
+ unwrap ( /** @type {import('#client ').ProxyStateObject } */ ( value ) , new Map ( ) )
142
142
) ;
143
143
}
144
144
145
145
/**
146
- * @param {import('./types.js ').Source<number> } signal
146
+ * @param {import('#client ').Source<number> } signal
147
147
* @param {1 | -1 } [d]
148
148
*/
149
149
function update_version ( signal , d = 1 ) {
150
150
set ( signal , signal . v + d ) ;
151
151
}
152
152
153
- /** @type {ProxyHandler<import('./types.js ').ProxyStateObject<any>> } */
153
+ /** @type {ProxyHandler<import('#client ').ProxyStateObject<any>> } */
154
154
const state_proxy_handler = {
155
155
defineProperty ( target , prop , descriptor ) {
156
156
if ( descriptor . value ) {
157
- /** @type {import('./types.js ').ProxyMetadata } */
157
+ /** @type {import('#client ').ProxyMetadata } */
158
158
const metadata = target [ STATE_SYMBOL ] ;
159
159
160
160
const s = metadata . s . get ( prop ) ;
@@ -165,7 +165,7 @@ const state_proxy_handler = {
165
165
} ,
166
166
167
167
deleteProperty ( target , prop ) {
168
- /** @type {import('./types.js ').ProxyMetadata } */
168
+ /** @type {import('#client ').ProxyMetadata } */
169
169
const metadata = target [ STATE_SYMBOL ] ;
170
170
const s = metadata . s . get ( prop ) ;
171
171
const is_array = metadata . a ;
@@ -198,7 +198,7 @@ const state_proxy_handler = {
198
198
return Reflect . get ( target , STATE_SYMBOL ) ;
199
199
}
200
200
201
- /** @type {import('./types.js ').ProxyMetadata } */
201
+ /** @type {import('#client ').ProxyMetadata } */
202
202
const metadata = target [ STATE_SYMBOL ] ;
203
203
let s = metadata . s . get ( prop ) ;
204
204
@@ -229,7 +229,7 @@ const state_proxy_handler = {
229
229
getOwnPropertyDescriptor ( target , prop ) {
230
230
const descriptor = Reflect . getOwnPropertyDescriptor ( target , prop ) ;
231
231
if ( descriptor && 'value' in descriptor ) {
232
- /** @type {import('./types.js ').ProxyMetadata } */
232
+ /** @type {import('#client ').ProxyMetadata } */
233
233
const metadata = target [ STATE_SYMBOL ] ;
234
234
const s = metadata . s . get ( prop ) ;
235
235
@@ -245,7 +245,7 @@ const state_proxy_handler = {
245
245
if ( prop === STATE_SYMBOL ) {
246
246
return true ;
247
247
}
248
- /** @type {import('./types.js ').ProxyMetadata } */
248
+ /** @type {import('#client ').ProxyMetadata } */
249
249
const metadata = target [ STATE_SYMBOL ] ;
250
250
const has = Reflect . has ( target , prop ) ;
251
251
@@ -266,7 +266,7 @@ const state_proxy_handler = {
266
266
} ,
267
267
268
268
set ( target , prop , value , receiver ) {
269
- /** @type {import('./types.js ').ProxyMetadata } */
269
+ /** @type {import('#client ').ProxyMetadata } */
270
270
const metadata = target [ STATE_SYMBOL ] ;
271
271
let s = metadata . s . get ( prop ) ;
272
272
// If we haven't yet created a source for this property, we need to ensure
@@ -329,7 +329,7 @@ const state_proxy_handler = {
329
329
} ,
330
330
331
331
ownKeys ( target ) {
332
- /** @type {import('./types.js ').ProxyMetadata } */
332
+ /** @type {import('#client ').ProxyMetadata } */
333
333
const metadata = target [ STATE_SYMBOL ] ;
334
334
335
335
get ( metadata . v ) ;
0 commit comments