Skip to main content

Package exports (index.ts)

DEVELOPER Intermediate

This page mirrors the public entry web/src/index.ts of the ez-console frontend package (same surface whether you browse the framework repo or the vendored copy under this docs workspace). Use it as a checklist when importing from 'ez-console'.

For narrative guides, see Application shell, Routing & navigation, API integration, React hooks & context, and Built-in components.


Application & types​

ExportKindNotes
EZAppComponent (default)Root app: router, providers, menus. Props type exported as EZAppProps (alias of AppProps in source).
EZAppPropsTypebasePath, transformRouter, transformSettingTabs, transformLangConfig, extraPrivateRoutes, extraPublicRoutes, menuStyle, transformHeaderItems, renderLayout, aiChatProps. See Application shell.

Internationalization​

ExportKindNotes
useTranslationHookRe-export from react-i18next.
i18nInstanceDefault i18next instance. See Internationalization.

Routing​

ExportKindNotes
withSuspenseFunctionWraps lazy components with <Suspense fallback={<Loading />}>.
IRouteTypeIRouteItem | IRouteGroup.
IRouteItemTypepath?, element (required), name?, icon?, is_private?, index (boolean β€” index vs non-index route), permissions?, hideInMenu?.
IRouteGroupTypechildren (required), optional path / element, name, icon, is_private, permissions, hideInMenu; index is optional and should be false for groups.

See Routing & navigation.


Layout & shell components​

ExportKindNotes
AppLayoutComponentMain admin shell (header, sider, breadcrumbs, AI affordances). Normally used inside the framework; override via EZApp’s renderLayout if needed. Props: AppLayoutProps (routes, siderWidth, transformLangConfig, menuStyle, transformHeaderItems, renderLayout, aiChatProps, …).
LoadingComponentSuspense / inline loading fallback.
LanguageSwitchComponentHeader language control; LanguageSwitchProps, AllLangUIConfig.
HeaderDropdownComponentHeader dropdown wrapper; HeaderDropdownProps.
Avatar, AvatarUploadComponentsUser avatar display / upload; AvatarProps, AvatarUploadProps.
DynamicIcon, getIconByNameComponent + utilIcon by configured name; DynamicIconProps.
LabelCreaterComponentTag-style label creator; LabelCreaterProps.

Tables, actions, markdown​

ExportKindNotes
TableComponentAnt Design table extended with request: (params: API.PaginationRequest) => Promise<API.PaginationResponse<T>> for server-driven pagination. Ref types: TableRefProps, TableActionRefProps, TableProps.
ActionsComponentRenders a row of action buttons (optional PermissionGuard per action, confirm, overflow menu). Item type ActionProps (key required).
MarkdownViewerComponentRenders Markdown; MarkdownViewerProps.
MarkdownCodeComponentCode block renderer exported as Code alias in index.ts (Code as MarkdownCode).

Auth, routes, errors​

ExportKindNotes
PermissionGuardComponentDeclarative RBAC; PermissionGuardProps.
AdminGuardComponentRenders children only for global admin.
PrivateRouteComponentAuth gate + optional requiredPermission / requiredPermissions; PrivateRouteProps.
ForbiddenPageHTTP 403–style page component.
NotFoundPage404 page component.

AI assistant UI​

ExportKindNotes
AIChatComponentFull chat UI; AIChatProps.
AIChatModalComponentModal host wired to useAI().visible.
AIChatSiderComponentResizable sidebar host.
AIChatButtonComponentFloat button to open assistant.

Behavior and useAI / registerPageAI are covered in React hooks & context β†’ useAI and AI model integration.


Forms & dynamic config​

ExportKindNotes
JsonSchemaConfigFormComponentRJSF-based form from JSON Schema for settings-style objects; JsonSchemaConfigFormRef via formRef.
JsonSchemaConfigFormItemComponentSingle-field variant for Ant Design Form integration.

ExportKindNotes
useAuthHookSession, login, logout, … β€” React hooks & context.
usePermissionHookRBAC helpers β€” same page.
useSiteHookSite config, org, tasks β€” same page.
useAIHookAI layout + page tools β€” same page.
PageAIOptions, RegisteredClientTool, ClientToolHandler, PageDataGetterTypesFrom @/contexts/AIContext.

HTTP client & low-level helpers​

ExportKindNotes
clientAxiosInstanceBase URL /api, JSON, auth + X-Scope-OrgID + Accept-Language interceptors.
requestFunctionTyped wrapper: normal JSON unwrap, requestType: 'form' (multipart), requestType: 'sse' (streams via fetchSSE), or responseType blob / text / arraybuffer.
apiGet, apiPost, apiPut, apiDeleteFunctionsThin client verbs returning unwrapped data.
fetchSSEFunctionfetch + ReadableStream for SSE bodies (used by request(..., { requestType: 'sse' })).
ApiErrorClasscode + message; thrown from error interceptor for JSON errors.

Details: API integration.


Generated REST client (api)​

The package builds a single object:

const api = {
...authorizationapi,
...baseapi,
...oauthapi,
...systemapi,
...aiapi,
...tasksapi,
};
  • Shape: one flat object of generated async functions (OpenAPI / codegen), e.g. api.listRoles, api.getCurrentUser, subject to name collisions if two modules ever export the same symbol (later spread wins). Prefer TypeScript and your generated typings to navigate.
  • Modules merged (star imports): authorization, base, oauth, system, tasks; aiapi is currently the same module instance as systemapi in source β€” redundant but harmless.
  • Inside the framework source tree, you may instead use import api from '@/service/api' for the nested layout (api.authorization.*, api.system.*, …). That default export is not re-exported from 'ez-console' β€” only the flat merged api from index.ts.

Generated request/response types are re-exported from the typing barrel:

export type * from '@/service/api/typing';

Use your editor’s completion on api.<method>(...) return values, or import the concrete types your bundler exposes from ez-console, to stay aligned with the generated OpenAPI surface.


Optional style import​

Consumer apps typically import the framework stylesheet once (see Quick start):

import 'ez-console/lib/style.css';

Need help? Ask in GitHub Discussions.