@viewfly/core 1.0.0-alpha.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/index.d.ts +593 -0
- package/bundles/index.esm.js +141 -180
- package/bundles/index.js +141 -180
- package/jsx-runtime/index.d.ts +9 -7
- package/package.json +8 -5
- package/rollup-d.config.ts +14 -0
- package/bundles/_utils/make-error.d.ts +0 -1
- package/bundles/di/_api.d.ts +0 -10
- package/bundles/di/forward-ref.d.ts +0 -10
- package/bundles/di/injectable.d.ts +0 -20
- package/bundles/di/injection-token.d.ts +0 -8
- package/bundles/di/injector.d.ts +0 -26
- package/bundles/di/metadata.d.ts +0 -43
- package/bundles/di/null-injector.d.ts +0 -6
- package/bundles/di/provider.d.ts +0 -30
- package/bundles/di/reflective-injector.d.ts +0 -31
- package/bundles/di/reflective-provider.d.ts +0 -20
- package/bundles/di/type.d.ts +0 -7
- package/bundles/di/utils/_api.d.ts +0 -3
- package/bundles/di/utils/annotations.d.ts +0 -33
- package/bundles/di/utils/decorators.d.ts +0 -17
- package/bundles/di/utils/stringify.d.ts +0 -1
- package/bundles/foundation/_api.d.ts +0 -8
- package/bundles/foundation/_utils.d.ts +0 -55
- package/bundles/foundation/component.d.ts +0 -243
- package/bundles/foundation/injection-tokens.d.ts +0 -18
- package/bundles/foundation/jsx-element.d.ts +0 -17
- package/bundles/foundation/memo.d.ts +0 -2
- package/bundles/foundation/renderer.d.ts +0 -3
- package/bundles/foundation/root.component.d.ts +0 -10
- package/bundles/foundation/types.d.ts +0 -43
- package/bundles/public-api.d.ts +0 -5
- package/bundles/viewfly.d.ts +0 -29
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Key } from './jsx-element';
|
|
2
|
-
import { ExtractInstanceType, DynamicRef } from './component';
|
|
3
|
-
import { Scope } from '../di/injectable';
|
|
4
|
-
import { NativeNode } from './injection-tokens';
|
|
5
|
-
import { Provider } from '../di/provider';
|
|
6
|
-
export type ViewNode = JSXInternal.ViewNode;
|
|
7
|
-
declare global {
|
|
8
|
-
namespace JSXInternal {
|
|
9
|
-
type ClassNames = string | Record<string, unknown> | false | null | undefined | ClassNames[];
|
|
10
|
-
interface ComponentInstance<P> {
|
|
11
|
-
$portalHost?: NativeNode;
|
|
12
|
-
$render(): ViewNode;
|
|
13
|
-
$useMemo?(currentProps: P, prevProps: P): boolean;
|
|
14
|
-
}
|
|
15
|
-
type ViewNode = Element | JSXInternal.ElementClass | string | number | boolean | null | undefined | Iterable<ViewNode>;
|
|
16
|
-
interface ComponentAnnotation {
|
|
17
|
-
scope?: Scope;
|
|
18
|
-
providers?: Provider[];
|
|
19
|
-
}
|
|
20
|
-
interface ComponentSetup<P = any> {
|
|
21
|
-
(props: P): (() => ViewNode) | ComponentInstance<P>;
|
|
22
|
-
annotation?: ComponentAnnotation;
|
|
23
|
-
}
|
|
24
|
-
type Element<P = any, C extends string | ComponentSetup<P> = string | ComponentSetup<P>> = C extends string ? IntrinsicElements[C] : (() => Element) | ComponentInstance<P>;
|
|
25
|
-
interface IntrinsicAttributes {
|
|
26
|
-
key?: Key;
|
|
27
|
-
ref?: any;
|
|
28
|
-
}
|
|
29
|
-
interface RefAttributes<T> extends IntrinsicAttributes {
|
|
30
|
-
ref?: DynamicRef<ExtractInstanceType<T>> | DynamicRef<ExtractInstanceType<T>>[];
|
|
31
|
-
}
|
|
32
|
-
interface ElementClass<P = any> extends ComponentInstance<P> {
|
|
33
|
-
}
|
|
34
|
-
interface ElementChildrenAttribute {
|
|
35
|
-
}
|
|
36
|
-
interface IntrinsicElements {
|
|
37
|
-
[name: string]: any;
|
|
38
|
-
}
|
|
39
|
-
interface IntrinsicClassAttributes<T> {
|
|
40
|
-
ref?: DynamicRef<T>;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
package/bundles/public-api.d.ts
DELETED
package/bundles/viewfly.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Provider } from './di/_api';
|
|
2
|
-
import { NativeNode, NativeRenderer } from './foundation/_api';
|
|
3
|
-
import { Injector } from './di/_api';
|
|
4
|
-
/**
|
|
5
|
-
* Viewfly 配置项
|
|
6
|
-
*/
|
|
7
|
-
export interface Config {
|
|
8
|
-
/** 根节点 */
|
|
9
|
-
root: JSXInternal.ViewNode;
|
|
10
|
-
/** 平台渲染器 */
|
|
11
|
-
nativeRenderer: NativeRenderer;
|
|
12
|
-
/** 应用的上下文 */
|
|
13
|
-
context?: Injector;
|
|
14
|
-
/** 是否自动更新视图 */
|
|
15
|
-
autoUpdate?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface Application<T extends NativeNode = NativeNode> {
|
|
18
|
-
provide(providers: Provider | Provider[]): Application<T>;
|
|
19
|
-
mount(host: T): Application<T>;
|
|
20
|
-
use(module: Module | Module[]): Application<T>;
|
|
21
|
-
render(): Application<T>;
|
|
22
|
-
destroy(): void;
|
|
23
|
-
}
|
|
24
|
-
export interface Module {
|
|
25
|
-
setup?(app: Application): void;
|
|
26
|
-
onAfterStartup?(app: Application): void;
|
|
27
|
-
onDestroy?(): void;
|
|
28
|
-
}
|
|
29
|
-
export declare function viewfly<T extends NativeNode>(config: Config): Application<T>;
|