type PageActionType = 'create' | 'update' | 'view' | 'edit' | 'copy'; declare namespace Global { type WithFalse = T | false; interface Pagination { page: number; perPage?: number; watch?: boolean; } interface PageResponse { items: T[]; pagination: { total: number; totalPage: number; page: number; perPage: number; }; } interface K8sPageResponse { apiVersion: string; items: T[]; kind: string; metadata: { continue?: string; resourceVersion: string; selfLink?: string; [key: string]: any; }; } interface K8sCommonData { kind: string; apiVersion: string; metadata: { name: string; namespace: string; [key: string]: any; }; [key: string]: any; } interface K8sSearchParams { allowWatchBookmarks?: boolean; continue?: string; fieldSelector?: string; labelSelector?: string; limit?: number; resourceVersion?: string; resourceVersionMatch?: string; sendInitialEvents?: boolean; timeoutSeconds?: number; watch?: boolean; [key: string]: any; } interface UserInfo { username: string; is_admin: boolean; full_name: string; require_password_change: boolean; id: number; source: string; avatar_url: string; org_name?: string; } type EmptyObject = Record; type BaseListItem = { key: string; locale?: boolean; value: T; } & Partial; type BaseOption = { label: string; locale?: boolean; value: T; meta?: Record; } & Partial; type BaseOptionGroup = { label: string; options?: BaseOption[]; }; interface HintOptions { label: string; value: string; opts?: Array>; } interface InitialStateType { fetchUserInfo: () => Promise; currentUser?: UserInfo; // Captured at app boot so access predicates can gate GPU Service — // the feature is Kubernetes-only, and Org members without a K8s // cluster they can schedule on shouldn't see the menu. Refreshed // by full page reload (e.g. OrgSwitcher) which re-runs // getInitialState. hasKubernetesCluster?: boolean; } type SearchParams = Pagination & { search?: string; [key: string]: any }; type MessageType = 'transition' | 'warning' | 'danger' | 'success' | 'info'; interface ScrollerModalProps { title?: string; action?: PageActionType; open: boolean; currentData?: T | null; onOk?: (values: U) => void; onCancel: () => void; } interface ActionItem { label: string; key: string; icon: React.ReactNode; locale?: boolean; props?: { danger?: boolean; }; visible?: (record: T) => boolean; disabled?: (record: T) => boolean; } } interface Window { __GPUSTACK_BODY_SCROLLER__?: any; }