Skip to content

Commit

Permalink
version upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
atellmer committed Dec 6, 2022
1 parent 6ae2cc6 commit 37454c7
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 785 deletions.
1,011 changes: 229 additions & 782 deletions examples/bench/index.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dark-engine/core",
"version": "0.12.0",
"version": "0.14.0",
"description": "Dark is lightweight (10 Kb gzipped) component-and-hook-based UI rendering engine for javascript apps without dependencies and written in TypeScript 💫",
"author": "AlexPlex",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/core/types/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export declare const ATTR_KEY = 'key';
export declare const ATTR_REF = 'ref';
export declare const PARTIAL_UPDATE = 'partial-update';
export declare enum TaskPriority {
ANIMATION = 3,
HIGH = 2,
NORMAL = 1,
LOW = 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/fiber/fiber.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare class Fiber<N = NativeElement> {
marker: string;
isUsed: boolean;
idx: number;
batched: () => void | null;
batched: number;
catchException: (error: Error) => void;
constructor(options: Partial<Fiber<N>>);
markMountedToHost(): void;
Expand Down
1 change: 1 addition & 0 deletions packages/core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export { useState } from './use-state';
export { useReactiveState } from './use-reactive-state';
export { useId } from './use-id';
export { useSyncExternalStore } from './use-sync-external-store';
export { useSpring, type Animation } from './use-spring';
export { walkFiber } from './walk';
export { unmountRoot } from './unmount';
export { batch } from './batch';
Expand Down
1 change: 1 addition & 0 deletions packages/core/types/platform/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { type VirtualNode } from '../view';
export declare type Platform = {
createNativeElement: <N>(vNode: VirtualNode) => N;
requestAnimationFrame: typeof requestAnimationFrame;
cancelAnimationFrame: typeof cancelAnimationFrame;
scheduleCallback: (callback: () => void, options?: ScheduleCallbackOptions) => void;
shouldYeildToHost: () => boolean;
applyCommit: (fiber: Fiber) => void;
Expand Down
1 change: 1 addition & 0 deletions packages/core/types/use-spring/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './use-spring';
39 changes: 39 additions & 0 deletions packages/core/types/use-spring/use-spring.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
declare type UseSpringOptions = {
state?: boolean;
getAnimations: (options: AnimationOptions) => Array<Animation>;
mount?: boolean;
deps?: Array<any>;
outside?: (values: Array<number>) => void;
};
declare function useSpring(
options: UseSpringOptions,
deps?: Array<any>,
): {
values: number[];
api: {
play: (name: string, direction: Direction, sourceIdx?: number) => Promise<boolean>;
toggle: {
filter: typeof filterToggle;
map: typeof mapToggle;
};
};
};
declare type AnimationOptions = {
state: boolean;
playingIdx: number;
};
export declare type Animation = {
name: string;
direction?: Direction;
mass?: number;
stiffness?: number;
damping?: number;
duration?: number;
delay?: number;
from?: number;
to?: number;
};
declare type Direction = 'forward' | 'backward' | 'mirrored';
declare function filterToggle(value: number, idx: number): boolean;
declare function mapToggle(value: number, size: number, idx: number): number;
export { useSpring };
2 changes: 2 additions & 0 deletions packages/core/types/view/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { DarkElementKey } from '../shared';
export declare type ViewDef = {
as: string;
slot?: any;
isVoid?: boolean;
key?: DarkElementKey;
[prop: string]: any;
};
export declare enum NodeType {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/types/view/view.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare const detectIsCommentVirtualNode: (vNode: unknown) => vNode is CommentVi
declare const detectIsTextVirtualNode: (vNode: unknown) => vNode is TextVirtualNode;
declare const detectIsEmptyVirtualNode: (vNode: unknown) => boolean;
declare function getVirtualNodeKey(vNode: TagVirtualNode): DarkElementKey | null;
declare function getVirtualNodeFactoryKey(factory: VirtualNodeFactory): DarkElementKey | null;
declare const createEmptyVirtualNode: () => CommentVirtualNode;
declare const detectIsVirtualNodeFactory: (factory: unknown) => factory is VirtualNodeFactory;
declare function View(def: ViewDef): TagVirtualNodeFactory;
Expand All @@ -52,6 +53,7 @@ export {
detectIsTextVirtualNode,
detectIsEmptyVirtualNode,
getVirtualNodeKey,
getVirtualNodeFactoryKey,
createEmptyVirtualNode,
detectIsVirtualNodeFactory,
View,
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dark-engine/platform-browser",
"version": "0.12.0",
"version": "0.14.0",
"description": "Dark is lightweight (10 Kb gzipped) component-and-hook-based UI rendering engine for javascript apps without dependencies and written in TypeScript 💫",
"author": "AlexPlex",
"license": "MIT",
Expand Down

0 comments on commit 37454c7

Please sign in to comment.