blockless
Rich Harris 2 years ago
parent 6be359bbc4
commit 987d5e9f6f

@ -26,7 +26,7 @@ import {
/** /**
* @template V * @template V
* @param {import('../types.js').SignalFlags} flags * @param {import('./types.js').SignalFlags} flags
* @param {V} value * @param {V} value
*/ */
function create_computation_signal(flags, value) { function create_computation_signal(flags, value) {
@ -69,7 +69,7 @@ export function push_reference(target_signal, ref_signal) {
} }
/** /**
* @param {import('../types.js').EffectType} type * @param {import('./types.js').EffectType} type
* @param {(() => void | (() => void))} fn * @param {(() => void | (() => void))} fn
* @param {boolean} sync * @param {boolean} sync
* @param {boolean} schedule * @param {boolean} schedule

@ -34,7 +34,7 @@ export function mutable_source(initial_value) {
/** /**
* @template V * @template V
* @param {import('../types.js').SignalFlags} flags * @param {import('./types.js').SignalFlags} flags
* @param {V} value * @param {V} value
* @returns {import('./types.js').Source<V> | import('./types.js').Source<V> & import('./types.js').SourceDebug} * @returns {import('./types.js').Source<V> | import('./types.js').Source<V> & import('./types.js').SourceDebug}
*/ */

@ -1,4 +1,14 @@
import type { Computation, EqualsFunctions, SignalFlags } from '../types'; import type { DERIVED, EFFECT, PRE_EFFECT, RENDER_EFFECT, SOURCE } from '../constants';
import type { Computation, EqualsFunctions } from '../types';
export type SignalFlags =
| typeof SOURCE
| typeof DERIVED
| typeof EFFECT
| typeof PRE_EFFECT
| typeof RENDER_EFFECT;
export type EffectType = typeof EFFECT | typeof PRE_EFFECT | typeof RENDER_EFFECT;
export type Source<V = unknown> = { export type Source<V = unknown> = {
/** consumers: Signals that read from the current signal */ /** consumers: Signals that read from the current signal */

@ -1,15 +1,5 @@
import { DERIVED, EFFECT, RENDER_EFFECT, SOURCE, PRE_EFFECT, STATE_SYMBOL } from './constants.js'; import { STATE_SYMBOL } from './constants.js';
import type { Source, SourceDebug } from './reactivity/types.js'; import type { SignalFlags, Source, SourceDebug } from './reactivity/types.js';
// Put all internal types in this file. Once we convert to JSDoc, we can make this a d.ts file
export type SignalFlags =
| typeof SOURCE
| typeof DERIVED
| typeof EFFECT
| typeof PRE_EFFECT
| typeof RENDER_EFFECT;
export type EffectType = typeof EFFECT | typeof PRE_EFFECT | typeof RENDER_EFFECT;
type EventCallback = (event: Event) => boolean; type EventCallback = (event: Event) => boolean;
export type EventCallbackMap = Record<string, EventCallback | EventCallback[]>; export type EventCallbackMap = Record<string, EventCallback | EventCallback[]>;

Loading…
Cancel
Save