taipy-gui.d.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. /*
  2. * Copyright 2021-2025 Avaiga Private Limited
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  5. * the License. You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  10. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  11. * specific language governing permissions and limitations under the License.
  12. */
  13. import * as React from "react"
  14. import { PaletteMode } from "@mui/material";
  15. import { Theme } from "@mui/material/styles";
  16. import { ComponentType, Dispatch, ReactNode } from "react";
  17. import { Socket } from "socket.io-client";
  18. export interface TaipyBaseProps {
  19. id?: string;
  20. libClassName?: string;
  21. className?: string;
  22. dynamicClassName?: string;
  23. privateClassName?: string;
  24. children?: ReactNode;
  25. }
  26. export interface TaipyDynamicProps extends TaipyBaseProps {
  27. updateVarName?: string;
  28. propagate?: boolean;
  29. updateVars?: string;
  30. }
  31. export interface TaipyHoverProps {
  32. hoverText?: string;
  33. defaultHoverText?: string;
  34. }
  35. export interface TaipyActiveProps extends TaipyDynamicProps, TaipyHoverProps {
  36. defaultActive?: boolean;
  37. active?: boolean;
  38. }
  39. export interface TaipyMultiSelectProps {
  40. selected?: number[];
  41. }
  42. export interface TaipyChangeProps {
  43. onChange?: string;
  44. }
  45. /**
  46. * Extracts the backend name of a property.
  47. *
  48. * @param updateVars - The value held by the property *updateVars*.
  49. * @param name - The name of a bound property.
  50. * @returns The backend-generated variable name.
  51. */
  52. export declare const getUpdateVar: (updateVars: string, name: string) => string | undefined;
  53. /**
  54. * Appends a suffix to the class names.
  55. *
  56. * @param names - The class names.
  57. * @param suffix - The suffix to append.
  58. * @returns The new list of class names.
  59. */
  60. export declare const getSuffixedClassNames: (names: string | undefined, suffix: string) => string;
  61. /**
  62. * An Icon representation.
  63. */
  64. export interface Icon {
  65. /** The URL to the image. */
  66. path: string;
  67. /** The text. */
  68. text: string;
  69. /** light theme path */
  70. lightPath?: string;
  71. /** dark theme path */
  72. darkPath?: string;
  73. }
  74. /**
  75. * A string or an icon.
  76. */
  77. export type stringIcon = string | Icon;
  78. /**
  79. * An item in a List of Values (LoV).
  80. */
  81. export interface LovItem {
  82. /** The unique identifier of this item. */
  83. id: string;
  84. /** The items label (string and/or icon). */
  85. item: stringIcon;
  86. /** The array of child items. */
  87. children?: LovItem[];
  88. }
  89. export interface MenuProps extends TaipyBaseProps {
  90. label?: string;
  91. width?: string;
  92. onAction?: string;
  93. inactiveIds?: string[];
  94. lov?: LovItem[];
  95. active?: boolean;
  96. selected?: string[];
  97. }
  98. export declare const getLocalStorageValue: <T = string>(key: string, defaultValue: T, values?: T[]) => T;
  99. export declare const storeClientId: (id: string) => void;
  100. export interface IdMessage {
  101. id: string;
  102. }
  103. export declare const TAIPY_CLIENT_ID = "TaipyClientId";
  104. export type WsMessageType =
  105. | "A"
  106. | "U"
  107. | "DU"
  108. | "MU"
  109. | "RU"
  110. | "AL"
  111. | "BL"
  112. | "NA"
  113. | "ID"
  114. | "MS"
  115. | "DF"
  116. | "PR"
  117. | "ACK"
  118. | "GA"
  119. | "FV"
  120. | "BC"
  121. | "LS";
  122. export interface WsMessage {
  123. type: WsMessageType;
  124. name: string;
  125. payload: Record<string, unknown> | unknown;
  126. propagate: boolean;
  127. client_id: string;
  128. module_context: string;
  129. ack_id?: string;
  130. }
  131. export declare const sendWsMessage: (
  132. socket: Socket | undefined,
  133. type: WsMessageType,
  134. name: string,
  135. payload: Record<string, unknown> | unknown,
  136. id: string,
  137. moduleContext?: string,
  138. propagate?: boolean,
  139. serverAck?: (val: unknown) => void
  140. ) => string;
  141. declare enum Types {
  142. SocketConnected = "SOCKET_CONNECTED",
  143. Update = "UPDATE",
  144. MultipleUpdate = "MULTIPLE_UPDATE",
  145. SendUpdate = "SEND_UPDATE_ACTION",
  146. Action = "SEND_ACTION_ACTION",
  147. RequestDataUpdate = "REQUEST_DATA_UPDATE",
  148. RequestUpdate = "REQUEST_UPDATE",
  149. SetLocations = "SET_LOCATIONS",
  150. SetTheme = "SET_THEME",
  151. SetTimeZone = "SET_TIMEZONE",
  152. SetNotification = "SET_NOTIFICATION",
  153. DeleteNotification = "DELETE_NOTIFICATION",
  154. SetBlock = "SET_BLOCK",
  155. Navigate = "NAVIGATE",
  156. ClientId = "CLIENT_ID",
  157. MultipleMessages = "MULTIPLE_MESSAGES",
  158. SetMenu = "SET_MENU",
  159. DownloadFile = "DOWNLOAD_FILE",
  160. Partial = "PARTIAL",
  161. Acknowledgement = "ACKNOWLEDGEMENT",
  162. Broadcast = "BROADCAST",
  163. LocalStorage = "LOCAL_STORAGE",
  164. RefreshThemes = "REFRESH_THEMES",
  165. }
  166. interface TaipyState {
  167. socket?: Socket;
  168. isSocketConnected?: boolean;
  169. data: Record<string, unknown>;
  170. themes: Record<PaletteMode, Theme>;
  171. theme: Theme;
  172. locations: Record<string, string>;
  173. timeZone?: string;
  174. dateFormat?: string;
  175. dateTimeFormat?: string;
  176. numberFormat?: string;
  177. notifications: NotificationMessage[];
  178. block?: BlockMessage;
  179. navigateTo?: string;
  180. navigateParams?: Record<string, string>;
  181. navigateTab?: string;
  182. navigateForce?: boolean;
  183. id: string;
  184. menu: MenuProps;
  185. download?: FileDownloadProps;
  186. ackList: string[];
  187. }
  188. interface TaipyBaseAction {
  189. type: Types;
  190. }
  191. export interface NamePayload {
  192. name: string;
  193. payload: Record<string, unknown>;
  194. }
  195. export interface NotificationMessage {
  196. nType: string;
  197. message: string;
  198. system: boolean;
  199. duration: number;
  200. notificationId?: string;
  201. snackbarId: string;
  202. }
  203. export interface TaipyAction extends NamePayload, TaipyBaseAction {
  204. propagate?: boolean;
  205. context?: string;
  206. }
  207. export interface BlockMessage {
  208. action: string;
  209. noCancel: boolean;
  210. close: boolean;
  211. message: string;
  212. }
  213. export interface FileDownloadProps {
  214. content?: string;
  215. name?: string;
  216. onAction?: string;
  217. context?: string;
  218. }
  219. export declare const INITIAL_STATE: TaipyState;
  220. export declare const taipyInitialize: (initialState: TaipyState) => TaipyState;
  221. export declare const initializeWebSocket: (socket: Socket | undefined, dispatch: Dispatch<TaipyBaseAction>) => void;
  222. export declare const taipyReducer: (state: TaipyState, baseAction: TaipyBaseAction) => TaipyState;
  223. /**
  224. * Create a *send update* `Action` that will be used to update `Context`.
  225. *
  226. * This action will update the variable *name* (if *propagate* is true) and trigger the
  227. * invocation of the `on_change` Python function on the backend.
  228. * @param name - The name of the variable holding the requested data
  229. * as received as a property.
  230. * @param value - The new value for the variable named *name*.
  231. * @param context - The execution context.
  232. * @param onChange - The name of the `on_change` Python function to
  233. * invoke on the backend (default is "on_change").
  234. * @param propagate - A flag indicating that the variable should be
  235. * automatically updated on the backend.
  236. * @param relName - The name of the related variable (for
  237. * example the lov when a lov value is updated).
  238. * @returns The action fed to the reducer.
  239. */
  240. export declare const createSendUpdateAction: (
  241. name: string | undefined,
  242. value: unknown,
  243. context: string | undefined,
  244. onChange?: string,
  245. propagate?: boolean,
  246. relName?: string
  247. ) => TaipyAction;
  248. /**
  249. * Create an *action* `Action` that will be used to update `Context`.
  250. *
  251. * This action will trigger the invocation of the `on_action` Python function on the backend,
  252. * providing all the parameters as a payload.
  253. * @param name - The name of the action function on the backend.
  254. * @param context - The execution context.
  255. * @param value - The value associated with the action. This can be an object or
  256. * any type of value.
  257. * @param args - Additional information associated to the action.
  258. * @returns The action fed to the reducer.
  259. */
  260. export declare const createSendActionNameAction: (
  261. name: string | undefined,
  262. context: string | undefined,
  263. value: unknown,
  264. ...args: unknown[]
  265. ) => TaipyAction;
  266. /**
  267. * Create a *request data update* `Action` that will be used to update the `Context`.
  268. *
  269. * This action will provoke the invocation of the `get_data()` method of the backend
  270. * library. That invocation generates an update of the elements holding the data named
  271. * *name* on the front-end.
  272. * @param name - The name of the variable holding the requested data as received as
  273. * a property.
  274. * @param id - The identifier of the visual element.
  275. * @param context - The execution context.
  276. * @param columns - The list of the columns needed by the element that emitted this
  277. * action.
  278. * @param pageKey - The unique identifier of the data that will be received from
  279. * this action.
  280. * @param payload - The payload (specific to the type of component
  281. * ie table, chart...).
  282. * @param allData - The flag indicating if all the data is requested.
  283. * @param library - The name of the {@link extension} library.
  284. * @returns The action fed to the reducer.
  285. */
  286. export declare const createRequestDataUpdateAction: (
  287. name: string | undefined,
  288. id: string | undefined,
  289. context: string | undefined,
  290. columns: string[],
  291. pageKey: string,
  292. payload: Record<string, unknown>,
  293. allData?: boolean,
  294. library?: string
  295. ) => TaipyAction;
  296. /**
  297. * Create a *request update* `Action` that will be used to update the `Context`.
  298. *
  299. * This action will generate an update of the elements holding the variables named
  300. * *names* on the front-end.
  301. * @param id - The identifier of the visual element.
  302. * @param context - The execution context.
  303. * @param names - The names of the requested variables as received in updateVarName and/or updateVars properties.
  304. * @param forceRefresh - Should Taipy re-evaluate the variables or use the current values
  305. * @returns The action fed to the reducer.
  306. */
  307. export declare const createRequestUpdateAction: (
  308. id: string | undefined,
  309. context: string | undefined,
  310. names: string[],
  311. forceRefresh?: boolean,
  312. stateContext?: Record<string, unknown>
  313. ) => TaipyAction;
  314. export declare const createRefreshThemesAction: () => TaipyBaseAction;
  315. /**
  316. * A column description as received by the backend.
  317. */
  318. export interface ColumnDesc {
  319. /** The unique column identifier. */
  320. dfid: string;
  321. /** The column type. */
  322. type: string;
  323. /** The value format. */
  324. format?: string;
  325. /** The column title. */
  326. title?: string;
  327. /** The order of the column. */
  328. index: number;
  329. /** The column width. */
  330. width?: number | string;
  331. /** If true, the column cannot be edited. */
  332. notEditable?: boolean;
  333. /** The name of the column that holds the CSS className to
  334. * apply to the cells. */
  335. className?: string;
  336. /** The name of the column that holds the tooltip to
  337. * show on the cells. */
  338. tooltip?: string;
  339. /** The name of the column that holds the formatted value to
  340. * show on the cells. */
  341. formatFn?: string;
  342. /** The value that would replace a NaN value. */
  343. nanValue?: string;
  344. /** The TimeZone identifier used if the type is `date`. */
  345. tz?: string;
  346. /** The flag that allows filtering. */
  347. filter?: boolean;
  348. /** The name of the aggregation function. */
  349. apply?: string;
  350. /** The flag that allows the user to aggregate the column. */
  351. groupBy?: boolean;
  352. widthHint?: number;
  353. /** The list of values that can be used on edit. */
  354. lov?: string[];
  355. /** If true the user can enter any value besides the lov values. */
  356. freeLov?: boolean;
  357. /** If false, the column cannot be sorted */
  358. sortable?: boolean;
  359. /** The column headers if more than one. */
  360. headers?: string[];
  361. /** The index of the multi index if exists. */
  362. multi?: number;
  363. }
  364. /**
  365. * A cell value type.
  366. */
  367. export type RowValue = string | number | boolean | null;
  368. /**
  369. * The definition of a table row.
  370. *
  371. * A row definition associates a name (a string) to a type (a {@link RowValue}).
  372. */
  373. export type RowType = Record<string, RowValue>;
  374. export type TableValueType = Record<string, Record<string, any>>;
  375. export interface TaipyTableProps extends TaipyActiveProps, TaipyMultiSelectProps {
  376. data?: TableValueType;
  377. columns?: string;
  378. defaultColumns: string;
  379. height?: string;
  380. width?: string;
  381. pageSize?: number;
  382. onEdit?: string;
  383. onDelete?: string;
  384. onAdd?: string;
  385. onAction?: string;
  386. editable?: boolean;
  387. defaultEditable?: boolean;
  388. rowClassName?: string;
  389. tooltip?: string;
  390. cellTooltip?: string;
  391. nanValue?: string;
  392. filter?: boolean;
  393. size?: "small" | "medium";
  394. defaultKey?: string;
  395. userData?: unknown;
  396. downloadable?: boolean;
  397. onCompare?: string;
  398. compare?: boolean;
  399. useCheckbox?: boolean;
  400. sortable?: boolean;
  401. }
  402. export interface TaipyPaginatedTableProps extends TaipyTableProps {
  403. pageSizeOptions?: string;
  404. allowAllRows?: boolean;
  405. showAll?: boolean;
  406. }
  407. export interface FilterDesc {
  408. col: string;
  409. action: string;
  410. value: string | number | boolean | Date;
  411. type: string;
  412. matchcase?: boolean;
  413. params?: number[];
  414. }
  415. export interface ChartProp extends TaipyActiveProps, TaipyChangeProps {
  416. title?: string;
  417. width?: string | number;
  418. height?: string | number;
  419. defaultConfig: string;
  420. config?: string;
  421. data?: Record<string, TraceValueType>;
  422. defaultLayout?: string;
  423. layout?: string;
  424. plotConfig?: string;
  425. onRangeChange?: string;
  426. render?: boolean;
  427. defaultRender?: boolean;
  428. template?: string;
  429. template_Dark_?: string;
  430. template_Light_?: string;
  431. figure?: Array<Record<string, unknown>>;
  432. onClick?: string;
  433. dataVarNames?: string;
  434. }
  435. export type TraceValueType = Record<string, (string | number)[]>;
  436. export declare const Chart: (props: ChartProp) => React.JSX.Element | null;
  437. export interface DialogProps extends TaipyActiveProps {
  438. title: string;
  439. onAction?: string;
  440. closeLabel?: string;
  441. labels?: string;
  442. page?: string;
  443. partial?: boolean;
  444. open?: boolean;
  445. defaultOpen?: string | boolean;
  446. children?: ReactNode;
  447. height?: string | number;
  448. width?: string | number;
  449. localAction?: (idx: number) => void;
  450. refId?: string;
  451. defaultRefId?: string;
  452. popup?: boolean;
  453. }
  454. export declare const Dialog: (props: DialogProps) => React.JSX.Element;
  455. export interface FileSelectorProps extends TaipyActiveProps {
  456. onAction?: string;
  457. defaultLabel?: string;
  458. label?: string;
  459. multiple?: boolean;
  460. selectionType?: string;
  461. extensions?: string;
  462. dropMessage?: string;
  463. notify?: boolean;
  464. width?: string | number;
  465. icon?: ReactNode;
  466. withBorder?: boolean;
  467. onUploadAction?: string;
  468. uploadData?: string;
  469. }
  470. export declare const FileSelector: (props: FileSelectorProps) => React.JSX.Element;
  471. export interface LoginProps extends TaipyBaseProps {
  472. title?: string;
  473. onAction?: string;
  474. defaultMessage?: string;
  475. message?: string;
  476. labels?: string;
  477. }
  478. export declare const Login: (props: LoginProps) => React.JSX.Element | null;
  479. export declare const Router: () => React.JSX.Element;
  480. export interface TableProps extends TaipyPaginatedTableProps {
  481. autoLoading?: boolean;
  482. }
  483. export declare const Table: ({ autoLoading, ...rest }: TableProps) => React.JSX.Element;
  484. export interface FilterColumnDesc extends ColumnDesc {
  485. params?: number[];
  486. }
  487. export interface TableFilterProps {
  488. fieldHeader?: string;
  489. fieldHeaderTooltip?: string;
  490. columns: Record<string, FilterColumnDesc>;
  491. colsOrder?: Array<string>;
  492. onValidate: (data: Array<FilterDesc>) => void;
  493. appliedFilters?: Array<FilterDesc>;
  494. className?: string;
  495. filteredCount: number;
  496. }
  497. export declare const TableFilter: (props: TableFilterProps) => React.JSX.Element;
  498. export interface SortDesc {
  499. col: string;
  500. order: boolean;
  501. params?: number[];
  502. }
  503. export interface SortColumnDesc extends ColumnDesc {
  504. params?: number[];
  505. }
  506. export interface TableSortProps {
  507. fieldHeader?: string;
  508. fieldHeaderTooltip?: string;
  509. columns: Record<string, SortColumnDesc>;
  510. colsOrder?: Array<string>;
  511. onValidate: (data: Array<SortDesc>) => void;
  512. appliedSorts?: Array<SortDesc>;
  513. className?: string;
  514. }
  515. export declare const TableSort: (props: TableSortProps) => React.JSX.Element;
  516. /**
  517. * A function that retrieves the dynamic className associated
  518. * to an instance of component through the style property
  519. *
  520. * @param children - The react children of the component
  521. * @returns The associated className.
  522. */
  523. export declare const getComponentClassName: (children: ReactNode) => string;
  524. export interface MetricProps extends TaipyBaseProps, TaipyHoverProps {
  525. value?: number;
  526. defaultValue?: number;
  527. delta?: number;
  528. defaultDelta?: number;
  529. type?: string;
  530. min?: number;
  531. max?: number;
  532. deltaColor?: string;
  533. negativeDeltaColor?: string;
  534. threshold?: number;
  535. defaultThreshold?: number;
  536. format?: string;
  537. deltaFormat?: string;
  538. barColor?: string;
  539. showValue?: boolean;
  540. colorMap?: string;
  541. title?: string;
  542. layout?: string;
  543. defaultLayout?: string;
  544. width?: string | number;
  545. height?: string | number;
  546. template?: string;
  547. template_Dark_?: string;
  548. template_Light_?: string;
  549. }
  550. export declare const Metric: (props: MetricProps) => React.JSX.Element;
  551. /**
  552. * A LoV (list of value) element.
  553. *
  554. * Each `LoVElt` holds:
  555. *
  556. * - Its identifier as a string;
  557. * - Its label (or icon) as a `stringIcon`;
  558. * - Potential child elements as an array of `LoVElt`s.
  559. */
  560. export type LoVElt = [string, stringIcon, LoVElt[]?];
  561. /**
  562. * A series of LoV elements.
  563. */
  564. export type LoV = LoVElt[];
  565. /**
  566. * A React hook that returns a LoV list from the LoV default value and the LoV bound value.
  567. * @param lov - The bound lov value.
  568. * @param defaultLov - The JSON-stringified default LoV value.
  569. * @param tree - This flag indicates if the LoV list is a tree or a flat list (default is false).
  570. * @returns A list of LoV items.
  571. */
  572. export declare const useLovListMemo: (lov: LoV | undefined, defaultLov: string, tree?: boolean) => LovItem[];
  573. interface TaipyStore {
  574. /** The State of the Taipy application. */
  575. state: TaipyState;
  576. /** The React *dispatch* function. */
  577. dispatch: Dispatch<TaipyBaseAction>;
  578. }
  579. /**
  580. * The Taipy-specific React context.
  581. *
  582. * The type of this variable is `React.Context<Store>`.
  583. */
  584. export declare const TaipyContext: React.Context<TaipyStore>;
  585. export interface PageStore {
  586. module?: string;
  587. }
  588. export declare const PageContext: React.Context<PageStore>;
  589. /**
  590. * A React hook to manage a dynamic scalar property.
  591. *
  592. * A dynamic scalar property is defined by a default property and a bound property.
  593. * @typeParam T - The dynamic property type.
  594. * @param value - The bound value.
  595. * @param defaultValue - The default value.
  596. * @param defaultStatic - The default static value.
  597. * @returns The latest updated value.
  598. */
  599. export declare const useDynamicProperty: <T>(
  600. value: T,
  601. defaultValue: T,
  602. defaultStatic: T,
  603. checkType?: string,
  604. nullToDefault?: boolean
  605. ) => T;
  606. /**
  607. * A React hook to manage a dynamic json property.
  608. *
  609. * A dynamic json property is defined by a default property and a bound property.
  610. * @typeParam T - The dynamic property type.
  611. * @param value - The bound value.
  612. * @param defaultValue - The default value.
  613. * @param defaultStatic - The default static value.
  614. * @returns The latest updated value.
  615. */
  616. export declare const useDynamicJsonProperty: <T>(
  617. value: string | undefined,
  618. defaultValue: string,
  619. defaultStatic: T
  620. ) => T;
  621. /**
  622. * A React hook that requests an update for every dynamic property of the element.
  623. * @param dispatch - The React dispatcher associated to `TaipyContext`.
  624. * @param id - The identifier of the element.
  625. * @param context - The execution context.
  626. * @param updateVars - The content of the property `updateVars`.
  627. * @param varName - The default property backend provided variable (through property `updateVarName`).
  628. * @param forceRefresh - Should Taipy re-evaluate the variables or use the current values.
  629. */
  630. export declare const useDispatchRequestUpdateOnFirstRender: (
  631. dispatch: Dispatch<TaipyBaseAction>,
  632. id?: string,
  633. context?: string,
  634. updateVars?: string,
  635. varName?: string,
  636. forceRefresh?: boolean
  637. ) => void;
  638. /**
  639. * A React hook that returns the *dispatch* function.
  640. *
  641. * The *dispatch* function allows to send Actions to the Store and initiate backend\
  642. * communications.
  643. * @returns The *dispatch* function.
  644. */
  645. export declare const useDispatch: () => Dispatch<TaipyBaseAction>;
  646. /**
  647. * A React hook that returns the page module.
  648. *
  649. * The *module* Needs to be added to all Actions to allow for the correct execution of backend functions.
  650. * @returns The page module.
  651. */
  652. export declare const useModule: () => string | undefined;
  653. /**
  654. * A React hook to manage classNames (dynamic and static).
  655. * cf. useDynamicProperty
  656. *
  657. * @param libClassName - The default static className.
  658. * @param dynamicClassName - The bound className.
  659. * @param className - The default user set className.
  660. * @returns The complete list of applicable classNames.
  661. */
  662. export declare const useClassNames: (libClassName?: string, dynamicClassName?: string, className?: string) => string;
  663. export declare const uploadFile: (
  664. varName: string,
  665. context: string | undefined,
  666. onAction: string | undefined,
  667. uploadData: string | undefined,
  668. files: FileList,
  669. progressCallback: (val: number) => void,
  670. id: string,
  671. uploadUrl?: string
  672. ) => Promise<string>;
  673. export declare const emptyArray: never[];
  674. export interface ErrorFallBackProps {
  675. error: Error;
  676. resetErrorBoundary: () => void;
  677. }
  678. export declare const ErrorFallback: (props: ErrorFallBackProps) => React.JSX.Element;
  679. export declare const getRegisteredComponents: () => Record<string, ComponentType<object>>;
  680. export declare const unregisteredRender: (tagName?: string, error?: string) => React.JSX.Element;
  681. export declare const renderError: (props: { error: string }) => React.JSX.Element;
  682. export { TaipyBaseAction as Action, TaipyContext as Context, TaipyState as State, TaipyStore as Store };
  683. export {};