Skip to content

Commit

Permalink
version upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
atellmer committed Nov 26, 2022
1 parent 533cc8c commit bcc78fa
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 18 deletions.
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.9.11",
"version": "0.9.12",
"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
19 changes: 13 additions & 6 deletions packages/core/types/component/component.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
import type { DarkElementKey, DarkElementInstance } from '../shared';
import type { Ref } from '../ref';
import type { CreateElement, ComponentOptions, StandardComponentProps } from './types';
import type { CreateElement, ComponentOptions, ShouldUpdate, StandardComponentProps } from './types';
declare class ComponentFactory<P extends StandardComponentProps = any, R = any> {
type: CreateElement<P>;
token: Symbol;
props: P;
ref: Ref<R>;
displayName: string;
children: Array<DarkElementInstance>;
shouldUpdate?: (props: P, nextProps: P) => boolean;
constructor(options: ComponentFactory<P>);
shouldUpdate?: ShouldUpdate<P>;
constructor(
type: CreateElement<P>,
token: Symbol,
props: P,
ref: Ref<R>,
shouldUpdate: ShouldUpdate<P>,
displayName: string,
);
}
declare function createComponent<P, R = any>(
createElement: CreateElement<P, R>,
declare function createComponent<P, R = unknown>(
type: CreateElement<P, R>,
options?: ComponentOptions<P>,
): (
props?: P & import('./types').KeyProps & import('./types').RefProps<unknown>,
ref?: Ref<R>,
) => ComponentFactory<P & import('./types').KeyProps & import('./types').RefProps<unknown>, any>;
) => ComponentFactory<P & StandardComponentProps>;
declare const detectIsComponentFactory: (factory: unknown) => factory is ComponentFactory<any, any>;
declare const getComponentFactoryKey: (factory: ComponentFactory) => DarkElementKey;
export { ComponentFactory, createComponent, detectIsComponentFactory, getComponentFactoryKey };
3 changes: 2 additions & 1 deletion packages/core/types/component/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ export declare type ComponentOptions<P extends StandardComponentProps> = Readonl
displayName?: string;
defaultProps?: Partial<P>;
token?: Symbol;
shouldUpdate?: (props: P, nextProps: P) => boolean;
shouldUpdate?: ShouldUpdate<P>;
}>;
export declare type ShouldUpdate<P> = (props: P, nextProps: P) => boolean;
export declare type StandardComponentProps = KeyProps & RefProps;
export declare type KeyProps = {
key?: DarkElementKey;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/fragment/fragment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ declare const Fragment: (
> &
KeyProps &
import('../component').RefProps<unknown>,
ref?: import('..').Ref<any>,
ref?: import('..').Ref<unknown>,
) => import('../component/component').ComponentFactory<
Required<
Readonly<{
Expand Down
9 changes: 7 additions & 2 deletions packages/core/types/memo/memo.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { type Component, type ComponentFactory, type StandardComponentProps, type SlotProps } from '../component';
import {
type Component,
type ComponentFactory,
type StandardComponentProps,
type SlotProps,
type ShouldUpdate,
} from '../component';
import { type Ref } from '../ref';
declare type ShouldUpdate<T> = (props: T, nextProps: T) => boolean;
declare const $$memo: unique symbol;
declare const detectIsMemo: (factory: unknown) => boolean;
declare function memo<T>(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/suspense/suspense.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare const Suspense: (
> &
import('../component').KeyProps &
import('../component').RefProps<unknown>,
ref?: import('..').Ref<any>,
ref?: import('..').Ref<unknown>,
) => import('../component/component').ComponentFactory<
{
fallback: DarkElement;
Expand Down
6 changes: 1 addition & 5 deletions packages/core/types/walk/walk.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { type Fiber } from '../fiber';
declare type WalkFiberOptions<T> = {
fiber: Fiber;
onLoop: (options: OnLoopOptions<T>) => void;
};
declare type OnLoopOptions<T> = {
nextFiber: Fiber<T>;
isReturn: boolean;
resetIsDeepWalking: () => void;
stop: () => void;
};
declare function walkFiber<T = unknown>(options: WalkFiberOptions<T>): void;
declare function walkFiber<T = unknown>(fiber: Fiber<T>, onLoop: (options: OnLoopOptions<T>) => void): void;
export { walkFiber };
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.9.11",
"version": "0.9.12",
"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 bcc78fa

Please sign in to comment.