Skip to content

Commit c87d27a

Browse files
committed
hide private types
1 parent a8d0940 commit c87d27a

File tree

2 files changed

+3
-138
lines changed

2 files changed

+3
-138
lines changed

packages/svelte/src/reactivity/window/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export const screenTop = new ReactiveValue(
100100
* `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`.
101101
* Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level,
102102
* on Firefox and Safari it won't
103+
* @type {{ get current(): number }}
103104
*/
104105
export const devicePixelRatio = /* @__PURE__ */ new (class DevicePixelRatio {
105106
#dpr = source(BROWSER ? window.devicePixelRatio : undefined);

packages/svelte/types/index.d.ts

Lines changed: 2 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,152 +1999,16 @@ declare module 'svelte/reactivity/window' {
19991999
* `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`.
20002000
* Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level,
20012001
* on Firefox and Safari it won't
2002-
*/
2002+
* */
20032003
export const devicePixelRatio: {
2004-
"__#19@#dpr": Source<number | undefined>;
2005-
"__#19@#update"(): void;
2006-
readonly current: number;
2004+
get current(): number;
20072005
};
2008-
// For all the core internal objects, we use single-character property strings.
2009-
// This not only reduces code-size and parsing, but it also improves the performance
2010-
// when the JS VM JITs the code.
2011-
2012-
type ComponentContext = {
2013-
/** parent */
2014-
p: null | ComponentContext;
2015-
/** context */
2016-
c: null | Map<unknown, unknown>;
2017-
/** deferred effects */
2018-
e: null | Array<{
2019-
fn: () => void | (() => void);
2020-
effect: null | Effect;
2021-
reaction: null | Reaction;
2022-
}>;
2023-
/** mounted */
2024-
m: boolean;
2025-
/**
2026-
* props — needed for legacy mode lifecycle functions, and for `createEventDispatcher`
2027-
* @deprecated remove in 6.0
2028-
*/
2029-
s: Record<string, unknown>;
2030-
/**
2031-
* exports (and props, if `accessors: true`) — needed for `createEventDispatcher`
2032-
* @deprecated remove in 6.0
2033-
*/
2034-
x: Record<string, any> | null;
2035-
/**
2036-
* legacy stuff
2037-
* @deprecated remove in 6.0
2038-
*/
2039-
l: null | {
2040-
/** local signals (needed for beforeUpdate/afterUpdate) */
2041-
s: null | Source[];
2042-
/** update_callbacks */
2043-
u: null | {
2044-
/** afterUpdate callbacks */
2045-
a: Array<() => void>;
2046-
/** beforeUpdate callbacks */
2047-
b: Array<() => void>;
2048-
/** onMount callbacks */
2049-
m: Array<() => any>;
2050-
};
2051-
/** `$:` statements */
2052-
r1: any[];
2053-
/** This tracks whether `$:` statements have run in the current cycle, to ensure they only run once */
2054-
r2: Source<boolean>;
2055-
};
2056-
/**
2057-
* dev mode only: the component function
2058-
*/
2059-
function?: any;
2060-
};
2061-
2062-
type Equals = (this: Value, value: unknown) => boolean;
2063-
2064-
type TemplateNode = Text | Element | Comment;
2065-
2066-
interface TransitionManager {
2067-
/** Whether the `global` modifier was used (i.e. `transition:fade|global`) */
2068-
is_global: boolean;
2069-
/** Called inside `resume_effect` */
2070-
in: () => void;
2071-
/** Called inside `pause_effect` */
2072-
out: (callback?: () => void) => void;
2073-
/** Called inside `destroy_effect` */
2074-
stop: () => void;
2075-
}
20762006
class ReactiveValue<T> {
20772007

20782008
constructor(fn: () => T, onsubscribe: (update: () => void) => void);
20792009
get current(): T;
20802010
#private;
20812011
}
2082-
interface Signal {
2083-
/** Flags bitmask */
2084-
f: number;
2085-
/** Write version */
2086-
version: number;
2087-
}
2088-
2089-
interface Value<V = unknown> extends Signal {
2090-
/** Signals that read from this signal */
2091-
reactions: null | Reaction[];
2092-
/** Equality function */
2093-
equals: Equals;
2094-
/** The latest value for this signal */
2095-
v: V;
2096-
}
2097-
2098-
interface Reaction extends Signal {
2099-
/** The associated component context */
2100-
ctx: null | ComponentContext;
2101-
/** The reaction function */
2102-
fn: null | Function;
2103-
/** Signals that this signal reads from */
2104-
deps: null | Value[];
2105-
}
2106-
2107-
interface Derived<V = unknown> extends Value<V>, Reaction {
2108-
/** The derived function */
2109-
fn: () => V;
2110-
/** Reactions created inside this signal */
2111-
children: null | Reaction[];
2112-
/** Parent effect or derived */
2113-
parent: Effect | Derived | null;
2114-
}
2115-
2116-
interface Effect extends Reaction {
2117-
/**
2118-
* Branch effects store their start/end nodes so that they can be
2119-
* removed when the effect is destroyed, or moved when an `each`
2120-
* block is reconciled. In the case of a single text/element node,
2121-
* `start` and `end` will be the same.
2122-
*/
2123-
nodes_start: null | TemplateNode;
2124-
nodes_end: null | TemplateNode;
2125-
/** Reactions created inside this signal */
2126-
deriveds: null | Derived[];
2127-
/** The effect function */
2128-
fn: null | (() => void | (() => void));
2129-
/** The teardown function returned from the effect function */
2130-
teardown: null | (() => void);
2131-
/** Transition managers created with `$.transition` */
2132-
transitions: null | TransitionManager[];
2133-
/** Next sibling child effect created inside the parent signal */
2134-
prev: null | Effect;
2135-
/** Next sibling child effect created inside the parent signal */
2136-
next: null | Effect;
2137-
/** First child effect created inside this signal */
2138-
first: null | Effect;
2139-
/** Last child effect created inside this signal */
2140-
last: null | Effect;
2141-
/** Parent effect */
2142-
parent: Effect | null;
2143-
/** Dev only */
2144-
component_function?: any;
2145-
}
2146-
2147-
type Source<V = unknown> = Value<V>;
21482012

21492013
export {};
21502014
}

0 commit comments

Comments
 (0)