global: snapshot

This commit is contained in:
nym21
2025-08-17 21:38:28 +02:00
parent 7d47bc8042
commit 05036c682f
51 changed files with 2551 additions and 6115 deletions
+11
View File
@@ -0,0 +1,11 @@
LICENSE
*.json
*webcomponent*
README.md
cli*
extras/
*.cjs
dev.js
*.development*
*.iife.*
nano.*
@@ -0,0 +1 @@
*.js
@@ -1,4 +1,4 @@
declare module "lean-qr" {
declare module 'lean-qr' {
interface ImageDataLike {
readonly data: Uint8ClampedArray;
}
@@ -11,7 +11,7 @@ declare module "lean-qr" {
interface CanvasLike<DataT extends ImageDataLike> {
width: number;
height: number;
getContext(type: "2d"): Context2DLike<DataT> | null;
getContext(type: '2d'): Context2DLike<DataT> | null;
}
/**
@@ -92,7 +92,7 @@ declare module "lean-qr" {
*/
toImageData<DataT extends ImageDataLike>(
context: Context2DLike<DataT>,
options?: Readonly<ImageDataOptions>
options?: Readonly<ImageDataOptions>,
): DataT;
/**
@@ -107,7 +107,7 @@ declare module "lean-qr" {
type?: `image/${string}`;
scale?: number;
}
>
>,
): string;
/**
@@ -121,7 +121,7 @@ declare module "lean-qr" {
*/
toCanvas(
canvas: CanvasLike<ImageDataLike>,
options?: Readonly<ImageDataOptions>
options?: Readonly<ImageDataOptions>,
): void;
}
@@ -205,7 +205,7 @@ declare module "lean-qr" {
*/
export type GenerateFn = (
data: Mode | string,
options?: Readonly<GenerateOptions>
options?: Readonly<GenerateOptions>,
) => Bitmap2D;
interface Generate extends GenerateFn {
/**
@@ -221,23 +221,23 @@ declare module "lean-qr" {
export const generate: Generate;
}
declare module "lean-qr/nano" {
declare module 'lean-qr/nano' {
import type {
Correction,
Bitmap2D as FullBitmap2D,
GenerateOptions as FullGenerateOptions,
} from "lean-qr";
import { correction as fullCorrection } from "lean-qr";
} from 'lean-qr';
import { correction as fullCorrection } from 'lean-qr';
export type { Correction };
export const correction: Pick<typeof fullCorrection, "L" | "M" | "Q" | "H">;
export const correction: Pick<typeof fullCorrection, 'L' | 'M' | 'Q' | 'H'>;
export type Bitmap2D = Pick<FullBitmap2D, "size" | "get" | "toCanvas">;
export type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get' | 'toCanvas'>;
export type GenerateOptions = Pick<
FullGenerateOptions,
"minCorrectionLevel" | "minVersion"
'minCorrectionLevel' | 'minVersion'
>;
/**
@@ -249,14 +249,14 @@ declare module "lean-qr/nano" {
*/
export function generate(
data: string,
options?: Readonly<GenerateOptions>
options?: Readonly<GenerateOptions>,
): Bitmap2D;
}
declare module "lean-qr/extras/svg" {
import type { Bitmap2D as FullBitmap2D } from "lean-qr";
declare module 'lean-qr/extras/svg' {
import type { Bitmap2D as FullBitmap2D } from 'lean-qr';
type Bitmap2D = Pick<FullBitmap2D, "size" | "get">;
type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get'>;
export interface SVGOptions {
/** the colour to use for modules which are 'on' (typically black) */
@@ -293,7 +293,7 @@ declare module "lean-qr/extras/svg" {
export function toSvg(
code: Bitmap2D,
target: Document | SVGElement,
options?: Readonly<SVGOptions>
options?: Readonly<SVGOptions>,
): SVGElement;
/**
@@ -311,7 +311,7 @@ declare module "lean-qr/extras/svg" {
/** `true` to include an XML declaration at the start of the source (for standalone documents which will not be embedded inside another document) */
xmlDeclaration?: boolean;
}
>
>,
): string;
/**
@@ -323,14 +323,14 @@ declare module "lean-qr/extras/svg" {
*/
export function toSvgDataURL(
code: Bitmap2D,
options?: Readonly<SVGOptions>
options?: Readonly<SVGOptions>,
): string;
}
declare module "lean-qr/extras/node_export" {
import type { RGBA, Bitmap2D as FullBitmap2D } from "lean-qr";
declare module 'lean-qr/extras/node_export' {
import type { RGBA, Bitmap2D as FullBitmap2D } from 'lean-qr';
type Bitmap2D = Pick<FullBitmap2D, "size" | "get">;
type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get'>;
export interface PNGOptions {
/** the colour to use for modules which are 'on' (typically black) */
@@ -355,7 +355,7 @@ declare module "lean-qr/extras/node_export" {
*/
export function toPngBuffer(
code: Bitmap2D,
options?: Readonly<PNGOptions>
options?: Readonly<PNGOptions>,
): Uint8Array;
/**
@@ -367,29 +367,29 @@ declare module "lean-qr/extras/node_export" {
*/
export function toPngDataURL(
code: Bitmap2D,
options?: Readonly<PNGOptions>
options?: Readonly<PNGOptions>,
): string;
}
declare module "lean-qr/extras/react" {
declare module 'lean-qr/extras/react' {
import type {
Bitmap2D as FullBitmap2D,
GenerateOptions,
ImageDataOptions,
} from "lean-qr";
} from 'lean-qr';
import type {
SVGOptions,
toSvgDataURL as toSvgDataURLFn,
} from "lean-qr/extras/svg";
} from 'lean-qr/extras/svg';
export interface AsyncFramework<T> {
createElement: (
type: "canvas",
type: 'canvas',
props: {
ref: any;
style: { imageRendering: "pixelated" };
style: { imageRendering: 'pixelated' };
className: string;
}
},
) => T;
useRef<T>(initialValue: T | null): { readonly current: T | null };
useEffect(fn: () => void | (() => void), deps: unknown[]): void;
@@ -406,7 +406,7 @@ declare module "lean-qr/extras/react" {
QRComponentProps {}
export type AsyncQRComponent<T> = (
props: Readonly<AsyncQRComponentProps>
props: Readonly<AsyncQRComponentProps>,
) => T;
/**
@@ -427,19 +427,19 @@ declare module "lean-qr/extras/react" {
framework: Readonly<AsyncFramework<T>>,
generate: (
data: string,
options?: Readonly<GenerateOptions>
) => Pick<FullBitmap2D, "toCanvas">,
defaultProps?: Readonly<Partial<AsyncQRComponentProps>>
options?: Readonly<GenerateOptions>,
) => Pick<FullBitmap2D, 'toCanvas'>,
defaultProps?: Readonly<Partial<AsyncQRComponentProps>>,
): AsyncQRComponent<T>;
export interface SyncFramework<T> {
createElement: (
type: "img",
type: 'img',
props: {
src: string;
style: { imageRendering: "pixelated" };
style: { imageRendering: 'pixelated' };
className: string;
}
},
) => T;
useMemo<T>(fn: () => T, deps: unknown[]): T;
}
@@ -471,14 +471,14 @@ declare module "lean-qr/extras/react" {
framework: Readonly<SyncFramework<T>>,
generate: (
data: string,
options?: Readonly<GenerateOptions>
) => Pick<FullBitmap2D, "size" | "get">,
options?: Readonly<GenerateOptions>,
) => Pick<FullBitmap2D, 'size' | 'get'>,
toSvgDataURL: typeof toSvgDataURLFn,
defaultProps?: Readonly<Partial<SyncQRComponentProps>>
defaultProps?: Readonly<Partial<SyncQRComponentProps>>,
): SyncQRComponent<T>;
}
declare module "lean-qr/extras/errors" {
declare module 'lean-qr/extras/errors' {
/**
* Convert an error into a human-readable message. This is intended for use
* with Lean QR errors, but will return somewhat meaningful messages for
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
URL + Version:
https://unpkg.com/browse/lean-qr@latest/
@@ -0,0 +1,6 @@
LICENSE
*.json
webcomponent*
README.md
cli*
extras/
@@ -9,28 +9,28 @@ declare class uFuzzy {
outOfOrder?: number,
/** default = 1e3 */
infoThresh?: number,
preFiltered?: uFuzzy.HaystackIdxs | null
preFiltered?: uFuzzy.HaystackIdxs | null,
): uFuzzy.SearchResult;
/** initial haystack filter, can accept idxs from previous prefix/typeahead match as optimization */
filter(
haystack: string[],
needle: string,
idxs?: uFuzzy.HaystackIdxs
idxs?: uFuzzy.HaystackIdxs,
): uFuzzy.HaystackIdxs | null;
/** collects stats about pre-filtered matches, does additional filtering based on term boundary settings, finds highlight ranges */
info(
idxs: uFuzzy.HaystackIdxs,
haystack: string[],
needle: string
needle: string,
): uFuzzy.Info;
/** performs final result sorting via Array.sort(), relying on Info */
sort(
info: uFuzzy.Info,
haystack: string[],
needle: string
needle: string,
): uFuzzy.InfoIdxOrder;
/** utility for splitting needle into terms following defined interSplit/intraSplit opts. useful for out-of-order permutes */
@@ -49,7 +49,7 @@ declare class uFuzzy {
mark?: (part: string, matched: boolean) => TMarkedPart,
accum?: TAccum,
append?: (accum: TAccum, part: TMarkedPart) => TAccum | undefined
append?: (accum: TAccum, part: TMarkedPart) => TAccum | undefined,
): TAccum;
}
@@ -72,7 +72,7 @@ declare namespace uFuzzy {
export type RankedResult = [
uFuzzy.HaystackIdxs,
uFuzzy.Info,
uFuzzy.InfoIdxOrder
uFuzzy.InfoIdxOrder,
];
export type SearchResult = FilteredResult | RankedResult | AbortedResult;
@@ -173,7 +173,7 @@ declare namespace uFuzzy {
info: Info,
haystack: string[],
needle: string,
compare?: CompareFn
compare?: CompareFn,
) => InfoIdxOrder;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
*charts.pro*
light*.js
@@ -1,7 +1,6 @@
// Generated by dts-bundle-generator v9.5.1
type CanvasRenderingTarget2D = any;
// import { CanvasRenderingTarget2D } from 'fancy-canvas';
declare const areaSeries: SeriesDefinition<"Area">;
declare const barSeries: SeriesDefinition<"Bar">;
@@ -4298,7 +4297,7 @@ export interface TouchMouseEventData {
*/
readonly ctrlKey: boolean;
/**
* Returns a boolean value that is true if the Alt (Option or ⌥ on macOS) key was active when the
* Returns a boolean value that is true if the Alt (Option or on macOS) key was active when the
* key event was generated.
*/
readonly altKey: boolean;
@@ -4307,8 +4306,8 @@ export interface TouchMouseEventData {
*/
readonly shiftKey: boolean;
/**
* Returns a boolean value that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on
* Windows keyboards, the Windows key (⊞)) was active when the key event was generated.
* Returns a boolean value that is true if the Meta key (on Mac keyboards, the Command key; on
* Windows keyboards, the Windows key ()) was active when the key event was generated.
*/
readonly metaKey: boolean;
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
// @ts-check
/** @import { IChartApi, ISeriesApi as _ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData as _BaselineData, SeriesType, IPaneApi, LineSeriesPartialOptions, BaselineSeriesPartialOptions, CandlestickSeriesPartialOptions, WhitespaceData, DeepPartial, ChartOptions, Time, LineData as _LineData } from './v5.0.8/types' */
/** @import { IChartApi, ISeriesApi as _ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData as _BaselineData, SeriesType, IPaneApi, LineSeriesPartialOptions, BaselineSeriesPartialOptions, CandlestickSeriesPartialOptions, WhitespaceData, DeepPartial, ChartOptions, Time, LineData as _LineData } from './5.0.8/dist/typings' */
/**
* @typedef {[number, number, number, number]} OHLCTuple
@@ -49,7 +49,7 @@ import {
CandlestickSeries,
LineSeries,
BaselineSeries,
} from "./v5.0.8/script.js";
} from "./5.0.8/dist/lightweight-charts.standalone.production.mjs";
const oklchToRGBA = createOklchToRGBA();
@@ -1 +0,0 @@
https://app.unpkg.com/@solidjs/signals@latest/files/dist/prod.js
@@ -1,3 +0,0 @@
export { Owner, getOwner, onCleanup, untrack } from "./core/index.js";
export type { SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
export * from "./signals.js";
@@ -1 +0,0 @@
export declare function reconcile<T extends U, U>(value: T, key: string | ((item: NonNullable<any>) => any)): (state: U) => T;
@@ -1,35 +0,0 @@
import { Computation } from "../core/index.js";
export type Store<T> = Readonly<T>;
export type StoreSetter<T> = (fn: (state: T) => void) => void;
type DataNode = Computation<any>;
type DataNodes = Record<PropertyKey, DataNode>;
declare const $RAW: unique symbol, $TRACK: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol;
export declare const STORE_VALUE = "v", STORE_NODE = "n", STORE_HAS = "h";
export { $PROXY, $TRACK, $RAW, $TARGET };
export type StoreNode = {
[STORE_VALUE]: Record<PropertyKey, any>;
[STORE_NODE]?: DataNodes;
[STORE_HAS]?: DataNodes;
};
export declare namespace SolidStore {
interface Unwrappable {
}
}
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
export declare function wrap<T extends Record<PropertyKey, any>>(value: T): T;
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
/**
* Returns the underlying data in the store without a proxy.
* @param item store proxy object
* @example
* ```js
* const initial = {z...};
* const [state, setState] = createStore(initial);
* initial === state; // => false
* initial === unwrap(state); // => true
* ```
*/
export declare function unwrap<T>(item: T, deep?: boolean, set?: Set<unknown>): T;
export declare function createStore<T extends object = {}>(store: T | Store<T>): [get: Store<T>, set: StoreSetter<T>];
export declare function createStore<T extends object = {}>(fn: (store: T) => void, store: T | Store<T>): [get: Store<T>, set: StoreSetter<T>];
export declare function deep<T extends object>(store: Store<T>): Store<any>;
@@ -32,6 +32,7 @@ export interface SignalOptions<T> {
id?: string;
name?: string;
equals?: ((prev: T, next: T) => boolean) | false;
pureWrite?: boolean;
unobserved?: () => void;
}
interface SourceType {
@@ -63,6 +64,7 @@ export declare class Computation<T = any> extends Owner implements SourceType, O
_name: string | undefined;
_equals: false | ((a: T, b: T) => boolean);
_unobserved: (() => void) | undefined;
_pureWrite: boolean;
/** Whether the computation is an error or has ancestors that are unresolved */
_stateFlags: number;
/** Which flags raised by sources are handled, vs. being passed through. */
@@ -7,7 +7,7 @@ import { Computation, type SignalOptions } from "./core.js";
*/
export declare class Effect<T = any> extends Computation<T> {
_effect: (val: T, prev: T | undefined) => void | (() => void);
_onerror: ((err: unknown) => void | (() => void)) | undefined;
_onerror: ((err: unknown, cleanup: () => void) => void) | undefined;
_cleanup: (() => void) | undefined;
_modified: boolean;
_prevValue: T | undefined;
@@ -20,15 +20,18 @@ export declare class Effect<T = any> extends Computation<T> {
_notify(state: number, skipQueue?: boolean): void;
_setError(error: unknown): void;
_disposeNode(): void;
_runEffect(type: number): void;
_run(type: number): void;
}
export declare class EagerComputation<T = any> extends Computation<T> {
constructor(initialValue: T, compute: () => T, options?: SignalOptions<T> & {
defer?: boolean;
});
_notify(state: number, skipQueue?: boolean): void;
_run(): void;
}
export declare class ProjectionComputation extends Computation {
export declare class FirewallComputation extends Computation {
firewall: boolean;
constructor(compute: () => void);
_notify(state: number, skipQueue?: boolean): void;
_run(): void;
}
@@ -6,6 +6,3 @@ export declare class NoOwnerError extends Error {
export declare class ContextNotFoundError extends Error {
constructor();
}
export declare class EffectError extends Error {
constructor(effect: Function, cause: unknown);
}
@@ -2,6 +2,6 @@ export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
export { Owner, createContext, getContext, setContext, hasContext, getOwner, onCleanup, type Context, type ContextRecord, type Disposable } from "./owner.js";
export { Computation, getObserver, isEqual, untrack, hasUpdated, isPending, latest, UNCHANGED, compute, runWithObserver, type SignalOptions } from "./core.js";
export { Effect, EagerComputation } from "./effect.js";
export { flushSync, Queue, incrementClock, getClock, type IQueue } from "./scheduler.js";
export { flush, Queue, incrementClock, getClock, type IQueue } from "./scheduler.js";
export * from "./constants.js";
export * from "./flags.js";
@@ -27,7 +27,7 @@ export declare class Queue implements IQueue {
export declare const globalQueue: Queue;
/**
* By default, changes are batched on the microtask queue which is an async process. You can flush
* the queue synchronously to get the latest updates by calling `flushSync()`.
* the queue synchronously to get the latest updates by calling `flush()`.
*/
export declare function flushSync(): void;
export declare function flush(): void;
export {};
@@ -0,0 +1,6 @@
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flush, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, runWithObserver, SUPPORTS_PROXY } from "./core/index.js";
export type { SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
export { mapArray, repeat, type Maybe } from "./map.js";
export * from "./signals.js";
export * from "./store/index.js";
export { createSuspense, createErrorBoundary, createBoundary, flatten, type BoundaryMode } from "./boundaries.js";
@@ -10,6 +10,10 @@ export type Setter<in out T> = {
export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
export type ComputeFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
export type EffectFunction<Prev, Next extends Prev = Prev> = (v: Next, p?: Prev) => (() => void) | void;
export type EffectBundle<Prev, Next extends Prev = Prev> = {
effect: EffectFunction<Prev, Next>;
error: (err: unknown, cleanup: () => void) => void;
};
export interface EffectOptions {
name?: string;
defer?: boolean;
@@ -77,6 +81,9 @@ export declare function createMemo<Next extends Prev, Init = Next, Prev = Next>(
*
* @description https://docs.solidjs.com/reference/basic-reactivity/create-async
*/
export declare function createAsync<T>(compute: (prev: T | undefined, refreshing: boolean) => Promise<T> | AsyncIterable<T> | T, value?: T, options?: MemoOptions<T>): Accessor<T> & {
refresh: () => void;
};
/**
* Creates a reactive effect that runs after the render phase
* ```typescript
@@ -95,8 +102,8 @@ export declare function createMemo<Next extends Prev, Init = Next, Prev = Next>(
*
* @description https://docs.solidjs.com/reference/basic-reactivity/create-effect
*/
export declare function createEffect<Next>(compute: ComputeFunction<undefined | NoInfer<Next>, Next>, effect: EffectFunction<NoInfer<Next>, Next>, error?: (err: unknown) => void): void;
export declare function createEffect<Next, Init = Next>(compute: ComputeFunction<Init | Next, Next>, effect: EffectFunction<Next, Next>, error: ((err: unknown) => void) | undefined, value: Init, options?: EffectOptions): void;
export declare function createEffect<Next>(compute: ComputeFunction<undefined | NoInfer<Next>, Next>, effect: EffectFunction<NoInfer<Next>, Next> | EffectBundle<NoInfer<Next>, Next>): void;
export declare function createEffect<Next, Init = Next>(compute: ComputeFunction<Init | Next, Next>, effect: EffectFunction<Next, Next> | EffectBundle<Next, Next>, value: Init, options?: EffectOptions): void;
/**
* Creates a reactive computation that runs during the render phase as DOM elements are created and updated but not necessarily connected
* ```typescript
@@ -114,6 +121,8 @@ export declare function createEffect<Next, Init = Next>(compute: ComputeFunction
*
* @description https://docs.solidjs.com/reference/secondary-primitives/create-render-effect
*/
export declare function createRenderEffect<Next>(compute: ComputeFunction<undefined | NoInfer<Next>, Next>, effect: EffectFunction<NoInfer<Next>, Next>): void;
export declare function createRenderEffect<Next, Init = Next>(compute: ComputeFunction<Init | Next, Next>, effect: EffectFunction<Next, Next>, value: Init, options?: EffectOptions): void;
/**
* Creates a new non-tracked reactive context with manual disposal
*
@@ -136,3 +145,38 @@ export declare function runWithOwner<T>(owner: Owner | null, run: () => T): T;
* Returns a promise of the resolved value of a reactive expression
* @param fn a reactive expression to resolve
*/
export declare function resolve<T>(fn: () => T): Promise<T>;
/**
* Runs the given function and returns a tuple with the result or an error.
* If the function throws an error, it will be caught and returned as the first element of the tuple.
* If the function returns a promise, it will resolve to a tuple with the result or an error.
*
* @param fn The function to run.
* @returns A tuple with either [undefined, result] or [error].
*
* @description https://docs.solidjs.com/reference/reactive-utilities/try-catch
*/
export type TryCatchResult<T, E> = [undefined, T] | [E];
export declare function tryCatch<T, E = Error>(fn: () => Promise<T>): Promise<TryCatchResult<T, E>>;
export declare function tryCatch<T, E = Error>(fn: () => T): TryCatchResult<T, E>;
/**
* Runs the given function in a transition scope, allowing for batch updates and optimizations.
* This is useful for grouping multiple state updates together to avoid unnecessary re-renders.
*
* @param fn A function that receives a resume function to continue the transition.
* The resume function can be called with another function to continue the transition.
*
* @description https://docs.solidjs.com/reference/advanced-reactivity/transition
*/
export declare function transition(fn: (resume: (fn: () => any | Promise<any>) => void) => any | Promise<any>): void;
/**
* Creates an optimistic signal that can be used to optimistically update a value
* and then revert it back to the previous value at end of transition.
*
* @param initial The initial value of the signal.
* @param compute An optional function to compute the next value based on the previous value and change.
* @param options Optional signal options.
*
* @returns A tuple containing an accessor for the current value and a setter function to apply changes.
*/
export declare function createOptimistic<T, U>(initial: T, compute?: (prev: T, change: U) => void, options?: SignalOptions<T>): [Accessor<T>, (v: U) => void];
@@ -1,6 +1,6 @@
export type { Store, StoreSetter, StoreNode, NotWrappable, SolidStore } from "./store.js";
export type { Merge, Omit } from "./utils.js";
export { unwrap, isWrappable, createStore, deep, $RAW, $TRACK, $PROXY, $TARGET } from "./store.js";
export { isWrappable, createStore, deep, $TRACK, $PROXY, $TARGET } from "./store.js";
export { createProjection } from "./projection.js";
export { reconcile } from "./reconcile.js";
export { merge, omit } from "./utils.js";
export { snapshot, merge, omit } from "./utils.js";
@@ -1,8 +1,7 @@
import { type Store, type StoreSetter } from "./store.js";
import { type Store } from "./store.js";
/**
* Creates a mutable derived value
*
* @see {@link https://github.com/solidjs/x-reactivity#createprojection}
*/
export declare function createProjection<T extends Object>(fn: (draft: T) => void, initialValue?: T): Store<T>;
export declare function wrapProjection<T>(fn: (draft: T) => void, store: Store<T>, setStore: StoreSetter<T>): [Store<T>, StoreSetter<T>];
@@ -0,0 +1 @@
export declare function reconcile<T extends U, U>(value: T, key: string | ((item: NonNullable<any>) => any), all?: boolean): (state: U) => void;
@@ -0,0 +1,33 @@
import { Computation } from "../core/index.js";
export type Store<T> = Readonly<T>;
export type StoreSetter<T> = (fn: (state: T) => void) => void;
type DataNode = Computation<any>;
type DataNodes = Record<PropertyKey, DataNode>;
export declare const $TRACK: unique symbol, $DEEP: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol, $DELETED: unique symbol;
export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_NODE = "n", STORE_HAS = "h", STORE_WRAP = "w", STORE_LOOKUP = "l";
export type StoreNode = {
[$PROXY]: any;
[STORE_VALUE]: Record<PropertyKey, any>;
[STORE_OVERRIDE]?: Record<PropertyKey, any>;
[STORE_NODE]?: DataNodes;
[STORE_HAS]?: DataNodes;
[STORE_WRAP]?: (value: any, target?: StoreNode) => any;
[STORE_LOOKUP]?: WeakMap<any, any>;
};
export declare namespace SolidStore {
interface Unwrappable {
}
}
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
export declare function createStoreProxy<T extends object>(value: T, traps?: ProxyHandler<StoreNode>, extend?: Record<PropertyKey, any>): any;
export declare const storeLookup: WeakMap<object, any>;
export declare function wrap<T extends Record<PropertyKey, any>>(value: T, target?: StoreNode): T;
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
export declare const storeTraps: ProxyHandler<StoreNode>;
export declare function storeSetter<T extends object>(store: Store<T>, fn: (draft: T) => void): void;
export declare function createStore<T extends object = {}>(store: T | Store<T>): [get: Store<T>, set: StoreSetter<T>];
export declare function createStore<T extends object = {}>(fn: (store: T) => void, store: T | Store<T>): [get: Store<T>, set: StoreSetter<T>];
export declare function deep<T extends object>(store: Store<T>): Store<any>;
export {};
@@ -1,3 +1,10 @@
/**
* Returns a non reactive copy of the store object.
* It will attempt to preserver the original reference unless the value has been modified.
* @param item store proxy object
*/
export declare function snapshot<T>(item: T): T;
export declare function snapshot<T>(item: T, map?: Map<unknown, unknown>, lookup?: WeakMap<any, any>): T;
type DistributeOverride<T, F> = T extends undefined ? F : T;
type Override<T, U> = T extends any ? U extends any ? {
[K in keyof T]: K extends keyof U ? DistributeOverride<U[K], T[K]> : T[K];
@@ -1,9 +1,9 @@
// @ts-check
/**
* @import { SignalOptions } from "./v0.3.2/types/core/core"
* @import { getOwner as GetOwner, onCleanup as OnCleanup } from "./v0.3.2/types/core/owner"
* @import { createSignal as CreateSignal, createEffect as CreateEffect, createMemo as CreateMemo, createRoot as CreateRoot, runWithOwner as RunWithOwner, Setter } from "./v0.3.2/types/signals";
* @import { SignalOptions } from "./0.4.1/dist/types/core/core"
* @import { getOwner as GetOwner, onCleanup as OnCleanup } from "./0.4.1/dist/types/core/owner"
* @import { createSignal as CreateSignal, createEffect as CreateEffect, createMemo as CreateMemo, createRoot as CreateRoot, runWithOwner as RunWithOwner, Setter } from "./0.4.1/dist/types/signals";
*/
/**
@@ -24,7 +24,7 @@ import {
createRoot,
runWithOwner,
onCleanup,
} from "./v0.3.2/script.js";
} from "./0.4.1/dist/prod.js";
let effectCount = 0;
@@ -75,7 +75,7 @@ const signals = {
createSignal(initialValue, options) {
const [get, set] = this.createSolidSignal(
/** @type {any} */ (initialValue),
options
options,
);
// @ts-ignore
@@ -94,7 +94,7 @@ const signals = {
typeof save.keyPrefix === "string"
? save.keyPrefix
: save.keyPrefix()
}-${paramKey}`
}-${paramKey}`,
);
let serialized = /** @type {string | null} */ (null);
@@ -116,7 +116,7 @@ const signals = {
try {
serialized = localStorage.getItem(storageKey);
set(() =>
serialized ? save.deserialize(serialized) : initialValue
serialized ? save.deserialize(serialized) : initialValue,
);
} catch (_) {}
}
@@ -184,7 +184,7 @@ function writeParam(key, value) {
window.history.replaceState(
null,
"",
`${window.location.pathname}?${urlParams.toString()}`
`${window.location.pathname}?${urlParams.toString()}`,
);
} catch (_) {}
}
@@ -1,8 +0,0 @@
URL:
https://github.com/leeoniya/uFuzzy/commits/main/dist
Head:
- SHA: 6bb27a8d8c41e4be5458844afc5c89f6c2399512
- Date: Feb 21, 2024
- Version: v1.0.18
File diff suppressed because it is too large Load Diff
+410
View File
@@ -0,0 +1,410 @@
#!/bin/bash
# unpkg-downloader.sh - Download complete packages from unpkg.com
# Usage: ./unpkg-downloader.sh <package-name> <version> [output-dir]
# Example: ./unpkg-downloader.sh "@solidjs/signals" "0.4.1"
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_debug() {
if [[ "${DEBUG:-}" == "1" ]]; then
echo -e "${YELLOW}[DEBUG]${NC} $1"
fi
}
# Check if required tools are installed
check_dependencies() {
local missing_deps=()
if ! command -v curl &> /dev/null; then
missing_deps+=("curl")
fi
if ! command -v grep &> /dev/null; then
missing_deps+=("grep")
fi
if ! command -v sed &> /dev/null; then
missing_deps+=("sed")
fi
if [ ${#missing_deps[@]} -ne 0 ]; then
print_error "Missing required dependencies: ${missing_deps[*]}"
print_error "Please install them and try again."
exit 1
fi
}
# Function to URL encode a string
url_encode() {
local string="${1}"
local strlen=${#string}
local encoded=""
local pos c o
for ((pos=0; pos<strlen; pos++)); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo "${encoded}"
}
# Function to create directory if it doesn't exist
create_dir() {
local dir="$1"
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
print_status "Created directory: $dir"
fi
}
# Function to resolve "latest" version to actual version number
resolve_latest_version() {
local package_name="$1"
local version="$2"
# If version is not "latest", return as-is
if [[ "$version" != "latest" ]]; then
echo "$version"
return
fi
print_status "Resolving 'latest' version for $package_name..." >&2
# URL encode the package name
local encoded_package=$(url_encode "$package_name")
local latest_url="https://app.unpkg.com/${encoded_package}@latest"
# Use curl to follow redirects and get the final URL
local final_url
final_url=$(curl -L -s -o /dev/null -w '%{url_effective}' "$latest_url")
if [[ -z "$final_url" ]]; then
print_error "Failed to resolve latest version for $package_name" >&2
return 1
fi
# Extract version from the final URL
# Format: https://app.unpkg.com/@solidjs/signals@0.4.1
local resolved_version
# Use a different delimiter (#) to avoid issues with / in package names
resolved_version=$(echo "$final_url" | sed -n "s#.*${package_name}@\([^\/]*\).*#\1#p")
if [[ -z "$resolved_version" ]]; then
print_error "Could not extract version from URL: $final_url" >&2
return 1
fi
print_success "Resolved 'latest' to version: $resolved_version" >&2
echo "$resolved_version"
}
# Function to download a file
download_file() {
local file_url="$1"
local local_path="$2"
local dir=$(dirname "$local_path")
create_dir "$dir"
print_status "Downloading: $file_url"
if curl -L -s -f "$file_url" -o "$local_path"; then
print_success "Downloaded: $local_path"
return 0
else
print_error "Failed to download: $file_url"
return 1
fi
}
# Function to parse HTML and extract file/folder links using a much simpler approach
parse_directory() {
local html_content="$1"
local current_path="$2"
local package_name="$3"
local version="$4"
print_debug "Parsing directory for path: '$current_path'"
# The HTML contains the original (unencoded) package name in URLs
# So we search for the original package name, not the encoded version
# Find all links that point to files/folders in this package
# Look for the pattern: <a href="...">filename</a> or <a href="...">foldername/</a>
local links=$(echo "$html_content" | grep -o '<a href="[^"]*"[^>]*>[^<]*</a>' | grep "${package_name}@${version}/files")
print_debug "Found $(echo "$links" | wc -l) total links"
if [[ "${DEBUG:-}" == "1" ]]; then
print_debug "All found links:"
echo "$links" | while read -r link; do
[[ -n "$link" ]] && print_debug " $link"
done
fi
echo "$links" | while read -r link_line; do
if [[ -z "$link_line" ]]; then
continue
fi
# Extract the href URL
local href=$(echo "$link_line" | sed -n 's/.*href="\([^"]*\)".*/\1/p')
# Extract the link text (what's between <a> and </a>)
local link_text=$(echo "$link_line" | sed -n 's/.*<a[^>]*>\([^<]*\)<\/a>.*/\1/p')
print_debug "Processing link: href='$href' text='$link_text'"
# Skip if we couldn't extract both parts
if [[ -z "$href" ]] || [[ -z "$link_text" ]]; then
continue
fi
# Skip parent directory links
if [[ "$link_text" == "../" ]] || [[ "$link_text" == ".." ]]; then
continue
fi
# Extract the file/folder path from the URL
# URL format: https://app.unpkg.com/@solidjs/signals@0.4.1/files/path/to/item
# Note: href contains the original (unencoded) package name
local url_path="${href#*${package_name}@${version}/files}"
url_path="${url_path#/}" # Remove leading slash
print_debug "URL path extracted: '$url_path'"
# Skip if this is not a direct child of current directory
if [[ -n "$current_path" ]]; then
# We're in a subdirectory, so the URL path should start with current_path
local current_clean="${current_path#/}"
if [[ "$url_path" != "${current_clean}"* ]]; then
print_debug "Skipping - not in current path"
continue
fi
# Get the relative path from current directory
local relative_path="${url_path#${current_clean}}"
relative_path="${relative_path#/}"
else
# We're in root, so relative_path is the same as url_path
local relative_path="$url_path"
fi
print_debug "Relative path: '$relative_path'"
# Skip if this contains subdirectories (we only want direct children)
if [[ "$relative_path" == *"/"* ]]; then
print_debug "Skipping - contains subdirectories"
continue
fi
# Skip empty paths
if [[ -z "$relative_path" ]]; then
continue
fi
# Determine if it's a folder or file based on the link text
if [[ "$link_text" == *"/" ]]; then
# It's a folder
local folder_name="${relative_path%/}"
if [[ -n "$current_path" ]]; then
echo "FOLDER:${current_path}/${folder_name}"
else
echo "FOLDER:/${folder_name}"
fi
else
# It's a file
if [[ -n "$current_path" ]]; then
echo "FILE:${current_path}/${relative_path}"
else
echo "FILE:/${relative_path}"
fi
fi
done
}
# Function to check if item was already processed
is_processed() {
local item="$1"
local processed_list="$2"
[[ "$processed_list" == *"|${item}|"* ]]
}
# Function to add item to processed list
add_processed() {
local item="$1"
local processed_list="$2"
echo "${processed_list}|${item}|"
}
# Function to process a directory (download files and recurse into subdirectories)
process_directory() {
local package_name="$1"
local version="$2"
local dir_path="$3"
local output_dir="$4"
local processed_dirs="$5"
# Encode the package name for URL
local encoded_package=$(url_encode "$package_name")
local app_url="https://app.unpkg.com/${encoded_package}@${version}/files${dir_path}"
local download_base_url="https://unpkg.com/${encoded_package}@${version}"
# Check if we've already processed this directory
if is_processed "$dir_path" "$processed_dirs"; then
print_warning "Already processed directory: $dir_path"
return
fi
print_status "Processing directory: ${dir_path:-'(root)'}"
print_status "Fetching: $app_url"
# Download the directory listing HTML
local html_content
if ! html_content=$(curl -L -s -f "$app_url"); then
print_error "Failed to fetch directory listing: $app_url"
return
fi
print_status "Fetched HTML content (${#html_content} characters)"
# Mark this directory as processed
processed_dirs=$(add_processed "$dir_path" "$processed_dirs")
# Parse the HTML to find files and folders
local items
items=$(parse_directory "$html_content" "$dir_path" "$package_name" "$version")
print_debug "Parsed items:"
print_debug "$items"
# Collect unique files and folders
local files=()
local folders=()
local seen_files=""
local seen_folders=""
while IFS= read -r item; do
[[ -z "$item" ]] && continue
if [[ "$item" == FILE:* ]]; then
local file_path="${item#FILE:}"
if ! is_processed "$file_path" "$seen_files"; then
files+=("$file_path")
seen_files=$(add_processed "$file_path" "$seen_files")
print_debug "Added file: $file_path"
fi
elif [[ "$item" == FOLDER:* ]]; then
local folder_path="${item#FOLDER:}"
if ! is_processed "$folder_path" "$seen_folders"; then
folders+=("$folder_path")
seen_folders=$(add_processed "$folder_path" "$seen_folders")
print_debug "Added folder: $folder_path"
fi
fi
done <<< "$items"
print_status "Found ${#files[@]} files and ${#folders[@]} folders"
# Download all files in this directory
for file_path in "${files[@]}"; do
if [[ -n "$file_path" ]]; then
local file_url="${download_base_url}${file_path}"
local local_path="${output_dir}${file_path}"
download_file "$file_url" "$local_path"
fi
done
# Recursively process all folders
for folder_path in "${folders[@]}"; do
if [[ -n "$folder_path" ]]; then
process_directory "$package_name" "$version" "$folder_path" "$output_dir" "$processed_dirs"
fi
done
}
# Main function
main() {
# Check dependencies
check_dependencies
# Parse command line arguments
if [ $# -lt 1 ] || [ $# -gt 3 ]; then
echo "Usage: $0 <package-name> [version] [output-dir]"
echo "Example: $0 \"@solidjs/signals\""
echo "Example: $0 \"@solidjs/signals\" \"0.4.1\""
echo "Example: $0 \"@solidjs/signals\" \"latest\""
echo "Example: $0 \"@solidjs/signals\" \"latest\" \"./downloads\""
echo "Example: $0 \"lodash\" \"4.17.21\" \"./downloads\""
echo ""
echo "Version defaults to 'latest' if not specified"
echo "Set DEBUG=1 environment variable for verbose output"
exit 1
fi
local package_name="$1"
local version="${2:-latest}"
# Resolve latest version if needed (do this once at the start)
local resolved_version
if ! resolved_version=$(resolve_latest_version "$package_name" "$version"); then
exit 1
fi
# Use resolved version for output directory
local output_dir="${3:-./$(echo "${package_name}" | sed 's/@//g' | sed 's/\//-/g')/${resolved_version}}"
print_status "Starting download of package: $package_name@$version"
if [[ "$version" == "latest" ]]; then
print_status "Resolved to actual version: $resolved_version"
fi
print_status "Output directory: $output_dir"
# Check if the directory already exists and has content
if [[ -d "$output_dir" ]] && [[ -n "$(ls -A "$output_dir" 2>/dev/null)" ]]; then
print_error "Directory already exists and is not empty: $output_dir"
print_error "Package $package_name@$resolved_version appears to already be downloaded."
print_error "Remove the directory or choose a different output location to proceed."
exit 1
fi
# Create the base output directory
create_dir "$output_dir"
# Start processing from the root directory using the resolved version
process_directory "$package_name" "$resolved_version" "" "$output_dir" ""
print_success "Package download completed!"
print_status "Files downloaded to: $output_dir"
}
# Run the main function with all arguments
main "$@"
+4
View File
@@ -0,0 +1,4 @@
./unpkg.sh "@solidjs/signals"
./unpkg.sh "@leeoniya/ufuzzy"
./unpkg.sh "lean-qr"
./unpkg.sh "lightweight-charts"
+5 -5
View File
@@ -3,9 +3,9 @@
/**
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, SeriesType } from "./options"
* @import { Valued, SingleValueData, CandlestickData, OHLCTuple, Series, ISeries, LineData, BaselineData, PartialLineStyleOptions, PartialBaselineStyleOptions, PartialCandlestickStyleOptions } from "../packages/lightweight-charts/wrapper"
* @import * as _ from "../packages/ufuzzy/v1.0.18/types"
* @import * as _ from "../packages/leeoniya-ufuzzy/1.0.18/dist/uFuzzy.d.ts"
* @import { SerializedChartableIndex } from "./chart";
* @import { Signal, Signals, Accessor } from "../packages/solid-signals/wrapper";
* @import { Signal, Signals, Accessor } from "../packages/solidjs-signals/wrapper";
* @import { DateIndex, DecadeIndex, DifficultyEpoch, Index, HalvingEpoch, Height, MonthIndex, P2PK33AddressIndex, P2PK65AddressIndex, P2PKHAddressIndex, P2SHAddressIndex, P2MSOutputIndex, P2AAddressIndex, P2TRAddressIndex, P2WPKHAddressIndex, P2WSHAddressIndex, TxIndex, InputIndex, OutputIndex, VecId, WeekIndex, SemesterIndex, YearIndex, VecIdToIndexes, QuarterIndex, EmptyOutputIndex, OpReturnIndex, UnknownOutputIndex } from "./vecid-to-indexes"
*/
@@ -63,7 +63,7 @@ const localhost = window.location.hostname === "localhost";
function initPackages() {
const imports = {
async signals() {
return import("../packages/solid-signals/wrapper.js").then(
return import("../packages/solidjs-signals/wrapper.js").then(
(d) => d.default,
);
},
@@ -75,10 +75,10 @@ function initPackages() {
);
},
async leanQr() {
return import("../packages/lean-qr/v2.5.0/script.js").then((d) => d);
return import("../packages/lean-qr/2.5.0/index.mjs").then((d) => d);
},
async ufuzzy() {
return import("../packages/ufuzzy/v1.0.18/script.js").then(
return import("../packages/leeoniya-ufuzzy/1.0.18/dist/uFuzzy.mjs").then(
({ default: d }) => d,
);
},