Skip to content

Commit 293f905

Browse files
authored
chore: use #client alias (#10974)
1 parent f303d82 commit 293f905

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

packages/svelte/src/internal/client/loop.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ function run_tasks(now) {
2222
/**
2323
* Creates a new task that runs on each raf frame
2424
* until it returns a falsy value or is aborted
25-
* @param {import('./types.js').TaskCallback} callback
26-
* @returns {import('./types.js').Task}
25+
* @param {import('#client').TaskCallback} callback
26+
* @returns {import('#client').Task}
2727
*/
2828
export function loop(callback) {
29-
/** @type {import('./types.js').TaskEntry} */
29+
/** @type {import('#client').TaskEntry} */
3030
let task;
3131

3232
if (raf.tasks.size === 0) {

packages/svelte/src/internal/client/proxy.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import { UNINITIALIZED } from '../../constants.js';
2222
* @param {T} value
2323
* @param {boolean} [immutable]
2424
* @param {Set<Function> | null} [owners]
25-
* @returns {import('./types.js').ProxyStateObject<T> | T}
25+
* @returns {import('#client').ProxyStateObject<T> | T}
2626
*/
2727
export function proxy(value, immutable = true, owners) {
2828
if (typeof value === 'object' && value != null && !is_frozen(value)) {
2929
// If we have an existing proxy, return it...
3030
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]);
3232
// ...unless the proxy belonged to a different object, because
3333
// someone copied the state symbol using `Reflect.ownKeys(...)`
3434
if (metadata.t === value || metadata.p === value) {
@@ -53,7 +53,7 @@ export function proxy(value, immutable = true, owners) {
5353
const proxy = new Proxy(value, state_proxy_handler);
5454

5555
define_property(value, STATE_SYMBOL, {
56-
value: /** @type {import('./types.js').ProxyMetadata} */ ({
56+
value: /** @type {import('#client').ProxyMetadata} */ ({
5757
s: new Map(),
5858
v: source(0),
5959
a: is_array(value),
@@ -86,7 +86,7 @@ export function proxy(value, immutable = true, owners) {
8686
}
8787

8888
/**
89-
* @template {import('./types.js').ProxyStateObject} T
89+
* @template {import('#client').ProxyStateObject} T
9090
* @param {T} value
9191
* @param {Map<T, Record<string | symbol, any>>} already_unwrapped
9292
* @returns {Record<string | symbol, any>}
@@ -138,23 +138,23 @@ function unwrap(value, already_unwrapped) {
138138
*/
139139
export function unstate(value) {
140140
return /** @type {T} */ (
141-
unwrap(/** @type {import('./types.js').ProxyStateObject} */ (value), new Map())
141+
unwrap(/** @type {import('#client').ProxyStateObject} */ (value), new Map())
142142
);
143143
}
144144

145145
/**
146-
* @param {import('./types.js').Source<number>} signal
146+
* @param {import('#client').Source<number>} signal
147147
* @param {1 | -1} [d]
148148
*/
149149
function update_version(signal, d = 1) {
150150
set(signal, signal.v + d);
151151
}
152152

153-
/** @type {ProxyHandler<import('./types.js').ProxyStateObject<any>>} */
153+
/** @type {ProxyHandler<import('#client').ProxyStateObject<any>>} */
154154
const state_proxy_handler = {
155155
defineProperty(target, prop, descriptor) {
156156
if (descriptor.value) {
157-
/** @type {import('./types.js').ProxyMetadata} */
157+
/** @type {import('#client').ProxyMetadata} */
158158
const metadata = target[STATE_SYMBOL];
159159

160160
const s = metadata.s.get(prop);
@@ -165,7 +165,7 @@ const state_proxy_handler = {
165165
},
166166

167167
deleteProperty(target, prop) {
168-
/** @type {import('./types.js').ProxyMetadata} */
168+
/** @type {import('#client').ProxyMetadata} */
169169
const metadata = target[STATE_SYMBOL];
170170
const s = metadata.s.get(prop);
171171
const is_array = metadata.a;
@@ -198,7 +198,7 @@ const state_proxy_handler = {
198198
return Reflect.get(target, STATE_SYMBOL);
199199
}
200200

201-
/** @type {import('./types.js').ProxyMetadata} */
201+
/** @type {import('#client').ProxyMetadata} */
202202
const metadata = target[STATE_SYMBOL];
203203
let s = metadata.s.get(prop);
204204

@@ -229,7 +229,7 @@ const state_proxy_handler = {
229229
getOwnPropertyDescriptor(target, prop) {
230230
const descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
231231
if (descriptor && 'value' in descriptor) {
232-
/** @type {import('./types.js').ProxyMetadata} */
232+
/** @type {import('#client').ProxyMetadata} */
233233
const metadata = target[STATE_SYMBOL];
234234
const s = metadata.s.get(prop);
235235

@@ -245,7 +245,7 @@ const state_proxy_handler = {
245245
if (prop === STATE_SYMBOL) {
246246
return true;
247247
}
248-
/** @type {import('./types.js').ProxyMetadata} */
248+
/** @type {import('#client').ProxyMetadata} */
249249
const metadata = target[STATE_SYMBOL];
250250
const has = Reflect.has(target, prop);
251251

@@ -266,7 +266,7 @@ const state_proxy_handler = {
266266
},
267267

268268
set(target, prop, value, receiver) {
269-
/** @type {import('./types.js').ProxyMetadata} */
269+
/** @type {import('#client').ProxyMetadata} */
270270
const metadata = target[STATE_SYMBOL];
271271
let s = metadata.s.get(prop);
272272
// If we haven't yet created a source for this property, we need to ensure
@@ -329,7 +329,7 @@ const state_proxy_handler = {
329329
},
330330

331331
ownKeys(target) {
332-
/** @type {import('./types.js').ProxyMetadata} */
332+
/** @type {import('#client').ProxyMetadata} */
333333
const metadata = target[STATE_SYMBOL];
334334

335335
get(metadata.v);

packages/svelte/src/internal/client/timing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const request_animation_frame = is_client ? requestAnimationFrame : noop;
66

77
const now = is_client ? () => performance.now() : () => Date.now();
88

9-
/** @type {import('./types.js').Raf} */
9+
/** @type {import('#client').Raf} */
1010
export const raf = {
1111
tick: /** @param {any} _ */ (_) => request_animation_frame(_),
1212
now: () => now(),

0 commit comments

Comments
 (0)