airx 0.4.0 → 0.7.1

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.
Files changed (150) hide show
  1. package/README.md +247 -63
  2. package/output/app/app.d.ts +41 -0
  3. package/output/app/app.d.ts.map +1 -0
  4. package/output/app/app.js +51 -0
  5. package/output/app/app.js.map +1 -0
  6. package/output/app/index.d.ts +2 -0
  7. package/output/app/index.d.ts.map +1 -0
  8. package/output/app/index.js +2 -0
  9. package/output/app/index.js.map +1 -0
  10. package/output/element/element.d.ts +108 -0
  11. package/output/element/element.d.ts.map +1 -0
  12. package/output/element/element.js +106 -0
  13. package/output/element/element.js.map +1 -0
  14. package/output/element/index.d.ts +2 -0
  15. package/output/element/index.d.ts.map +1 -0
  16. package/output/element/index.js +2 -0
  17. package/output/element/index.js.map +1 -0
  18. package/output/index.d.ts +40 -0
  19. package/output/index.d.ts.map +1 -0
  20. package/output/index.js +36 -0
  21. package/output/index.js.map +1 -0
  22. package/output/jsx-dev-runtime.d.ts +4 -0
  23. package/output/jsx-dev-runtime.d.ts.map +1 -0
  24. package/output/jsx-dev-runtime.js +9 -0
  25. package/output/jsx-dev-runtime.js.map +1 -0
  26. package/output/jsx-runtime.d.ts +23 -0
  27. package/output/jsx-runtime.d.ts.map +1 -0
  28. package/output/jsx-runtime.js +24 -0
  29. package/output/jsx-runtime.js.map +1 -0
  30. package/output/logger/index.d.ts +2 -0
  31. package/output/logger/index.d.ts.map +1 -0
  32. package/output/logger/index.js +2 -0
  33. package/output/logger/index.js.map +1 -0
  34. package/output/{esm → logger}/logger.d.ts +1 -0
  35. package/output/logger/logger.d.ts.map +1 -0
  36. package/output/logger/logger.js +17 -0
  37. package/output/logger/logger.js.map +1 -0
  38. package/output/{esm/render/common/index.d.ts → render/basic/common.d.ts} +4 -3
  39. package/output/render/basic/common.d.ts.map +1 -0
  40. package/output/render/basic/common.js +436 -0
  41. package/output/render/basic/common.js.map +1 -0
  42. package/output/render/basic/hooks/hooks.d.ts +61 -0
  43. package/output/render/basic/hooks/hooks.d.ts.map +1 -0
  44. package/output/render/basic/hooks/hooks.js +72 -0
  45. package/output/render/basic/hooks/hooks.js.map +1 -0
  46. package/output/render/basic/hooks/index.d.ts +2 -0
  47. package/output/render/basic/hooks/index.d.ts.map +1 -0
  48. package/output/render/basic/hooks/index.js +2 -0
  49. package/output/render/basic/hooks/index.js.map +1 -0
  50. package/output/render/basic/index.d.ts +2 -0
  51. package/output/render/basic/index.d.ts.map +1 -0
  52. package/output/render/basic/index.js +2 -0
  53. package/output/render/basic/index.js.map +1 -0
  54. package/output/{umd/render/common/plugins → render/basic/plugins/context}/context.d.ts +2 -1
  55. package/output/render/basic/plugins/context/context.d.ts.map +1 -0
  56. package/output/render/basic/plugins/context/context.js +12 -0
  57. package/output/render/basic/plugins/context/context.js.map +1 -0
  58. package/output/render/basic/plugins/context/index.d.ts +2 -0
  59. package/output/render/basic/plugins/context/index.d.ts.map +1 -0
  60. package/output/render/basic/plugins/context/index.js +2 -0
  61. package/output/render/basic/plugins/context/index.js.map +1 -0
  62. package/output/render/basic/plugins/index.d.ts +3 -0
  63. package/output/render/basic/plugins/index.d.ts.map +1 -0
  64. package/output/render/basic/plugins/index.js +2 -0
  65. package/output/render/basic/plugins/index.js.map +1 -0
  66. package/output/{umd/render/common/plugins/internal → render/basic/plugins/internal/basic}/basic.d.ts +4 -3
  67. package/output/render/basic/plugins/internal/basic/basic.d.ts.map +1 -0
  68. package/output/render/basic/plugins/internal/basic/basic.js +158 -0
  69. package/output/render/basic/plugins/internal/basic/basic.js.map +1 -0
  70. package/output/render/basic/plugins/internal/basic/index.d.ts +2 -0
  71. package/output/render/basic/plugins/internal/basic/index.d.ts.map +1 -0
  72. package/output/render/basic/plugins/internal/basic/index.js +2 -0
  73. package/output/render/basic/plugins/internal/basic/index.js.map +1 -0
  74. package/output/render/basic/plugins/internal/inject/index.d.ts +2 -0
  75. package/output/render/basic/plugins/internal/inject/index.d.ts.map +1 -0
  76. package/output/render/basic/plugins/internal/inject/index.js +2 -0
  77. package/output/render/basic/plugins/internal/inject/index.js.map +1 -0
  78. package/output/{umd/render/common/plugins/internal → render/basic/plugins/internal/inject}/inject.d.ts +3 -2
  79. package/output/render/basic/plugins/internal/inject/inject.d.ts.map +1 -0
  80. package/output/render/basic/plugins/internal/inject/inject.js +25 -0
  81. package/output/render/basic/plugins/internal/inject/inject.js.map +1 -0
  82. package/output/{umd/render/common/plugins/index.d.ts → render/basic/plugins/plugin.d.ts} +3 -3
  83. package/output/render/basic/plugins/plugin.d.ts.map +1 -0
  84. package/output/render/basic/plugins/plugin.js +2 -0
  85. package/output/render/basic/plugins/plugin.js.map +1 -0
  86. package/output/{esm/render → render/browser}/browser.d.ts +4 -3
  87. package/output/render/browser/browser.d.ts.map +1 -0
  88. package/output/render/browser/browser.js +218 -0
  89. package/output/render/browser/browser.js.map +1 -0
  90. package/output/render/browser/index.d.ts +2 -0
  91. package/output/render/browser/index.d.ts.map +1 -0
  92. package/output/render/browser/index.js +2 -0
  93. package/output/render/browser/index.js.map +1 -0
  94. package/output/render/index.d.ts +5 -0
  95. package/output/render/index.d.ts.map +1 -0
  96. package/output/render/index.js +5 -0
  97. package/output/render/index.js.map +1 -0
  98. package/output/render/server/index.d.ts +2 -0
  99. package/output/render/server/index.d.ts.map +1 -0
  100. package/output/render/server/index.js +2 -0
  101. package/output/render/server/index.js.map +1 -0
  102. package/output/{umd/render → render/server}/server.d.ts +3 -2
  103. package/output/render/server/server.d.ts.map +1 -0
  104. package/output/render/server/server.js +314 -0
  105. package/output/render/server/server.js.map +1 -0
  106. package/output/signal/index.d.ts +4 -0
  107. package/output/signal/index.d.ts.map +1 -0
  108. package/output/signal/index.js +2 -0
  109. package/output/signal/index.js.map +1 -0
  110. package/output/{esm/signal/index.d.ts → signal/signal.d.ts} +1 -1
  111. package/output/signal/signal.d.ts.map +1 -0
  112. package/output/signal/signal.js +46 -0
  113. package/output/signal/signal.js.map +1 -0
  114. package/output/symbol/index.d.ts +2 -0
  115. package/output/symbol/index.d.ts.map +1 -0
  116. package/output/symbol/index.js +2 -0
  117. package/output/symbol/index.js.map +1 -0
  118. package/output/types/index.d.ts +2 -0
  119. package/output/types/index.d.ts.map +1 -0
  120. package/output/types/index.js +2 -0
  121. package/output/types/index.js.map +1 -0
  122. package/output/{esm → types}/types.d.ts +3 -1
  123. package/output/types/types.d.ts.map +1 -0
  124. package/output/types/types.js +2 -0
  125. package/output/types/types.js.map +1 -0
  126. package/package.json +42 -15
  127. package/output/esm/element.d.ts +0 -48
  128. package/output/esm/index.d.ts +0 -14
  129. package/output/esm/index.js +0 -1289
  130. package/output/esm/index.js.map +0 -1
  131. package/output/esm/render/common/hooks.d.ts +0 -10
  132. package/output/esm/render/common/plugins/context.d.ts +0 -5
  133. package/output/esm/render/common/plugins/index.d.ts +0 -19
  134. package/output/esm/render/common/plugins/internal/basic.d.ts +0 -10
  135. package/output/esm/render/common/plugins/internal/inject.d.ts +0 -6
  136. package/output/esm/render/index.d.ts +0 -4
  137. package/output/esm/render/server.d.ts +0 -5
  138. package/output/esm/symbol.d.ts +0 -2
  139. package/output/umd/element.d.ts +0 -48
  140. package/output/umd/index.d.ts +0 -14
  141. package/output/umd/index.js +0 -1304
  142. package/output/umd/index.js.map +0 -1
  143. package/output/umd/logger.d.ts +0 -3
  144. package/output/umd/render/browser.d.ts +0 -7
  145. package/output/umd/render/common/hooks.d.ts +0 -10
  146. package/output/umd/render/common/index.d.ts +0 -64
  147. package/output/umd/render/index.d.ts +0 -4
  148. package/output/umd/signal/index.d.ts +0 -6
  149. package/output/umd/symbol.d.ts +0 -2
  150. package/output/umd/types.d.ts +0 -1173
@@ -1,48 +0,0 @@
1
- import * as symbol from './symbol';
2
- type AirxElementType<P> = string | AirxComponent<P>;
3
- export type Props = {
4
- [propKey: string]: unknown;
5
- };
6
- /**
7
- * AirxElement 表示一个 Airx 元素
8
- * type 表示元素的类型,可能是一个 html 标签,
9
- * 也可能是一个自定义组件
10
- * props 表示元素的属性
11
- * children 表示元素的子元素
12
- */
13
- export interface AirxElement<P = any> {
14
- type: AirxElementType<P>;
15
- props: Props & P;
16
- [symbol.airxElementSymbol]: true;
17
- }
18
- export type AirxChildren = null | string | number | boolean | undefined | AirxElement | Array<AirxChildren> | AirxComponentRender;
19
- /**
20
- * 函数式组件接收自己的 props,并返回一个 AirxElement
21
- */
22
- export type AirxComponentRender = () => AirxChildren;
23
- export type AirxComponent<P = unknown> = ReactiveComponent<P>;
24
- export type ReactiveComponent<P = unknown> = (props: P) => AirxComponentRender;
25
- /**
26
- * createElement 是用于创建 AirxElement 的工具函数
27
- */
28
- export declare function createElement<P = any>(type: AirxElementType<P>, props: {
29
- [key: string]: unknown;
30
- } & P, ...children: AirxChildren[]): AirxElement<P>;
31
- export declare function isValidElement(element: unknown): element is AirxElement;
32
- export declare function Fragment(props: {
33
- children: AirxElement;
34
- }): () => AirxElement<any>;
35
- export type AirxComponentUnmountedListener = () => void;
36
- export type AirxComponentMountedListener = () => (() => void) | void;
37
- export interface AirxComponentLifecycle {
38
- onMounted: (listener: AirxComponentMountedListener) => void;
39
- onUnmounted: (listener: AirxComponentUnmountedListener) => void;
40
- }
41
- type ProvideUpdater<T = unknown> = (newValue: T | ((old: T) => T)) => void;
42
- export type AirxComponentContext = AirxComponentLifecycle & {
43
- provide: <T = unknown>(key: unknown, value: T) => ProvideUpdater<T>;
44
- inject: <T = unknown>(key: unknown) => T | undefined;
45
- };
46
- export declare function component<P = unknown>(comp: AirxComponent<P>): AirxComponent<P>;
47
- export declare function createErrorRender(error: unknown): AirxComponentRender;
48
- export {};
@@ -1,14 +0,0 @@
1
- import { Plugin } from './render';
2
- import { AirxComponent, AirxElement } from './element';
3
- export * from './types';
4
- export { Plugin } from './render';
5
- export { Fragment, component, createElement, AirxComponent, AirxElement, AirxChildren, AirxComponentContext } from './element';
6
- export { inject, provide, onMounted, onUnmounted } from './render';
7
- export interface AirxApp {
8
- mount: (container: HTMLElement) => AirxApp;
9
- /** @deprecated WIP */
10
- plugin: (...plugins: Plugin[]) => AirxApp;
11
- /** @deprecated WIP */
12
- renderToHTML: () => Promise<string>;
13
- }
14
- export declare function createApp(element: AirxElement<any> | AirxComponent): AirxApp;