element.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. import { IElementContext } from './hooks.js';
  2. import { ETargetPlatform, EElementType } from './types.js';
  3. export interface IAppxOptions {
  4. data: Record<string, any>;
  5. options: Record<string, string>;
  6. methods?: Record<string, (args: any) => void>;
  7. [handlerName: string]: any;
  8. }
  9. export type TElementFunction<TProps> = (props: TProps) => {
  10. [axmlKey: string]: any;
  11. };
  12. export interface IInstanceMap {
  13. [id: string]: {
  14. appxContext: IElementContext;
  15. appxId: string;
  16. elementFn: any;
  17. elementInstance?: any;
  18. pendingProps: any;
  19. unmounted: boolean;
  20. propKeys: string[];
  21. };
  22. }
  23. export declare function flushReactTree(elementMap: IInstanceMap): import("preact").VNode<import("preact").ClassAttributes<HTMLElement> | null>;
  24. export interface ElementOption {
  25. options?: any;
  26. }
  27. export declare function functionalMiniElement<TProps>(element: TElementFunction<TProps>, displayName: string | undefined, elementType: EElementType, defaultProps?: TProps, _targetPlatform?: ETargetPlatform, elementOption?: ElementOption): Record<string, any>;