import * as React$1 from 'react'; import { useState, Dispatch, SetStateAction, ReactNode } from 'react'; import { CheckboxProps as CheckboxProps$1 } from '@patternfly/react-core/dist/dynamic/components/Checkbox'; import { FormProps as FormProps$1 } from '@patternfly/react-core/dist/dynamic/components/Form'; import { FormSelectProps as FormSelectProps$1 } from '@patternfly/react-core/dist/dynamic/components/FormSelect'; import { TextProps } from '@patternfly/react-core/dist/dynamic/components/Text'; import { TextAreaProps } from '@patternfly/react-core/dist/dynamic/components/TextArea'; import { TextInputProps } from '@patternfly/react-core/dist/dynamic/components/TextInput'; import { SwitchProps as SwitchProps$1 } from '@patternfly/react-core/dist/dynamic/components/Switch'; import { ButtonVariant } from '@patternfly/react-core/dist/dynamic/components/Button'; import { ModalProps } from '@patternfly/react-core/dist/dynamic/components/Modal'; import { BreadcrumbItemProps } from '@patternfly/react-core/dist/dynamic/components/Breadcrumb'; import { FilterChipsFilter } from '@redhat-cloud-services/frontend-components/FilterChips'; import { DeepReadonly } from 'ts-essentials'; import { Middleware } from 'redux'; import * as react_fetching_library from 'react-fetching-library'; import { QueryResponse, RequestInterceptor, ResponseInterceptor } from 'react-fetching-library'; import * as _redhat_cloud_services_javascript_clients_shared from '@redhat-cloud-services/javascript-clients-shared'; import * as endpoints from '@redhat-cloud-services/rbac-client'; import { AccessPagination } from '@redhat-cloud-services/rbac-client/types'; interface OuiaComponentProps { ouiaId?: string; ouiaSafe?: boolean; } interface UseOuiaReturn { 'data-ouia-component-type': string; 'data-ouia-component-id'?: string; 'data-ouia-safe': boolean; } declare const setOuiaPage: (type: string, action?: string | undefined, objectId?: string | undefined) => void; declare const getOuiaPropsFactory: (module: string) => (type: string, oiuaProps: OuiaComponentProps) => UseOuiaReturn; declare const withoutOuiaProps: (props: T) => Omit; declare const ouiaIdConcat: (ouiaIdParent: string | undefined, ouiaId: string) => string; declare const AppSkeleton: React$1.FunctionComponent; interface RenderIfProps { renderIf: () => boolean; children: React$1.ReactNode; } interface RenderIfTrueFalse { _value?: boolean; children: React$1.ReactNode; } declare const RenderIfTrue: React$1.FunctionComponent; declare const RenderIfFalse: React$1.FunctionComponent; declare const RenderIf: React$1.FunctionComponent; declare enum ExporterType { JSON = "json", CSV = "csv" } declare const exporterTypeFromString: (value: string) => ExporterType; interface Exporter { readonly type: ExporterType; export(elements: Array): Blob; } declare enum ImmutableContainerSetMode { INCLUDE = 0, EXCLUDE = 1 } declare class ImmutableContainerSet { readonly mode: ImmutableContainerSetMode; private readonly set; constructor(set?: Iterable, mode?: ImmutableContainerSetMode); static include(included?: Iterable): ImmutableContainerSet; static exclude(excluded?: Iterable): ImmutableContainerSet; values(): T[]; add(value: T): ImmutableContainerSet; addIterable(values: Iterable): ImmutableContainerSet; remove(value: T): ImmutableContainerSet; removeIterable(values: Iterable): ImmutableContainerSet; size(max?: number): number; contains(value: T): boolean; private update; } declare class Page { static readonly NO_SIZE = -1; readonly index: number; readonly size: number; readonly filter?: Filter; readonly sort?: Sort; private constructor(); hasFilter(): boolean; start(): number; end(): number; withPage(index: number): Page; nextPage(): Page; withSort(sort: Sort | undefined): Page; toQuery(): Record>; static of(index: number, size?: number, filter?: Filter, sort?: Sort): Page; static defaultPage(): Page; static lastPageForElements(count: number, size: number): Page; } declare class FilterElement { readonly column: string; readonly operator: Operator; readonly value: string | Array; constructor(column: string, operator: Operator, value: string | Array); } declare class Filter { private _elements; readonly elements: DeepReadonly; constructor(); and(column: string, operator: Operator, value: string | Array): this; } declare class Sort { readonly column: string; readonly direction: Direction; private constructor(); static by(column: string, direction: Direction): Sort; } declare enum Direction { ASCENDING = "ASC", DESCENDING = "DESC" } declare enum Operator { EQUAL = "EQUAL", LIKE = "LIKE", ILIKE = "ILIKE", NOT_EQUAL = "NOT_EQUAL", BOOLEAN_IS = "BOOLEAN_IS" } declare type OnSortHandlerType = (index: number, column: string, direction: Direction) => void; declare type Verb = string; declare type What = string; declare type App = string; declare type WhatPermissions = Array; declare type AppPermissions = Record; declare type RbacPermission = Record; declare class Rbac { private permissions; constructor(permissions: RbacPermission); hasPermission(app: App, what: What, verb: Verb): boolean; private hasWhatPermission; private hasAppPermission; } interface HasToString { toString: () => string; } declare type Setter = (val: T | ((prev: T) => T)) => void; declare type StandardFilterEnum = Record; declare type FilterContent = string | Array | undefined; declare type EnumElement = Enum[keyof Enum]; declare type FilterBase, T> = Record, T>; declare type OptionalFilterBase, T> = FilterBase; declare type Filters> = FilterBase; declare type SetFilters> = FilterBase>; declare type ClearFilterElement> = { [P in EnumElement]?: FilterContent; }; declare type ClearFilters> = (columns: ClearFilterElement) => void; declare const stringValue: (val: string | Array | undefined, separator?: string) => string; declare const arrayValue: (val: string | Array | undefined, separator?: string) => Array; interface Entitlement { is_entitled: boolean; } interface UserData { username: string; email: string; first_name: string; last_name: string; is_active: boolean; is_org_admin: boolean; is_internal: boolean; locale: string; } interface Internal { org_id: string; account_id: number; } interface Identity { account_number: string; type: string; user: UserData; internal: Internal; } interface User { identity: Identity; entitlements: Record; } declare type InsightsType = { chrome: { init: () => void; identifyApp: (appId: string) => Promise; getApp: () => string; getBundle: () => string; getEnvironment: () => 'ci' | 'qa' | 'prod' | 'stage'; on: (type: string, callback: ((event: any) => void)) => void; auth: { getUser: () => Promise; }; isProd: boolean; isBeta: () => boolean; isPenTest: () => boolean; }; }; declare const waitForInsights: () => Promise; declare const getInsights: () => InsightsType; declare const nonBetaEnvironments: readonly ["ci", "qa", "stage", "prod", "gov", "govStage"]; declare const betaEnvironments: ("ci-beta" | "qa-beta" | "prod-beta" | "stage-beta" | "gov-beta" | "govStage-beta")[]; declare type NonBetaEnvironment = typeof nonBetaEnvironments[number]; declare type BetaEnvironment = typeof betaEnvironments[number]; declare type Environment = NonBetaEnvironment | BetaEnvironment; declare type Environments = Record<'all' | 'beta' | 'nonBeta' | 'prod' | 'nonProd' | 'ci' | 'qa' | 'stage' | 'govProd' | 'govStage', ReadonlyArray>; declare const Environments: Environments; declare const getInsightsEnvironment: (insights: InsightsType) => Environment; declare type SemiPartial = Pick & Partial>; declare type Headers = Array<[keyof ReturnType['serialize']>, string]>; declare type ExporterHeaders, T> = Array<[keyof ReturnType, string]>; declare type SerializedObject = { [key: string]: HasToString | undefined; }; declare abstract class ExporterCsv implements Exporter { readonly type = ExporterType.CSV; private encode; export(elements: Array): Blob; abstract headers(): Headers; abstract serialize(element: T): SerializedObject; } declare abstract class ExporterJson implements Exporter { readonly type = ExporterType.JSON; export(elements: Array): Blob; } declare enum NotificationType { SUCCESS = "success", DANGER = "danger", WARNING = "warning", INFO = "info" } declare const addNotification: (type: NotificationType, title: string, description: React.ReactNode, dismissable?: boolean | undefined) => void; declare type ExplicitNotificationFunction = (title: string, description: React.ReactNode, dismissable?: boolean) => void; declare const addSuccessNotification: ExplicitNotificationFunction; declare const addDangerNotification: ExplicitNotificationFunction; declare const addInfoNotification: ExplicitNotificationFunction; declare const addWarningNotification: ExplicitNotificationFunction; declare const clearNotifications: () => void; declare type ExpectedQueryResponse = QueryResponse & { query: (...args: Array) => Promise>; }; declare type ExpectedMutateResponse = QueryResponse & { mutate: (...args: Array) => Promise>; }; declare type UseTransformQueryResponseTypeQuery, TO> = Omit & { query: (...args: Parameters) => Promise>; payload: undefined | TO; }; declare type UseTransformQueryResponseTypeMutation, TO> = Omit & { mutate: (...args: Parameters) => Promise>; payload: undefined | TO; }; interface UseTransformQueryResponseType { >(queryResponse: USE_QUERY_RESPONSE_FROM, adapter: (from: FROM) => TO): UseTransformQueryResponseTypeQuery; >(queryResponse: USE_MUTATE_RESPONSE_FROM, adapter: (from: FROM) => TO): UseTransformQueryResponseTypeMutation; } declare const useTransformQueryResponse: UseTransformQueryResponseType; declare type JoinType = (elements: Array, GlueComponent: React$1.ElementType) => Array; declare const join: JoinType; declare const joinClasses: (...args: string[]) => string; declare const toUtc: (date: Date) => Date; declare const fromUtc: (date: Date) => Date; interface FetchingClientOptions { requestInterceptors?: Array; responseInterceptors?: Array; } declare const createFetchingClient: (getInsights: () => InsightsType, options?: FetchingClientOptions | undefined) => { cache: { add: (action: react_fetching_library.Action, value: react_fetching_library.QueryResponse) => void; remove: (action: react_fetching_library.Action) => void; get: (action: react_fetching_library.Action) => (react_fetching_library.QueryResponse & { timestamp: number; }) | undefined; getItems: () => { [key: string]: react_fetching_library.QueryResponse; }; setItems: (items: { [key: string]: react_fetching_library.QueryResponse; }) => void; } | undefined; query: (actionInit: react_fetching_library.Action, skipCache?: boolean | undefined) => Promise>; suspenseCache: { add: (action: react_fetching_library.Action, value: { fetch: any; response?: react_fetching_library.QueryResponse | undefined; }) => void; remove: (action: react_fetching_library.Action) => void; get: (action: react_fetching_library.Action) => ({ fetch: any; response?: react_fetching_library.QueryResponse | undefined; } & { timestamp: number; }) | undefined; getItems: () => { [key: string]: { fetch: any; response?: react_fetching_library.QueryResponse | undefined; }; }; setItems: (items: { [key: string]: { fetch: any; response?: react_fetching_library.QueryResponse | undefined; }; }) => void; }; }; declare const getBaseName: (pathname: string) => string; declare const rbacApi: _redhat_cloud_services_javascript_clients_shared.BaseAPI & _redhat_cloud_services_javascript_clients_shared.APIFactoryResponse; declare class RbacPermissionsBuilder { readonly accessPagination: AccessPagination; constructor(accessPagination: AccessPagination); build(): RbacPermission; } declare const fetchRBAC: (appQuery: string) => Promise; declare const BetaIf: React$1.FunctionComponent; declare const BetaIfNot: React$1.FunctionComponent; declare type BetaDetectorProps = { children: React$1.ReactNode; isBeta: boolean; }; declare const BetaDetector: React$1.FunctionComponent; interface InsightsBetaDetectorProps$1 extends Omit { insights: InsightsType; } declare const InsightsBetaDetector: React$1.FunctionComponent; interface EmailOptInProps extends OuiaComponentProps { content: string; isBeta: boolean; bundle: string; } declare const EmailOptIn: React$1.FunctionComponent; declare type Partials = 'isBeta' | 'bundle'; declare type InsightsEmailOptInPropsType = Partial> & Omit; interface InsightsEmailOptInProps extends InsightsEmailOptInPropsType { insights: InsightsType; } declare const InsightsEmailOptIn: React$1.FunctionComponent; interface EmptyStateSectionProps extends OuiaComponentProps { icon?: React$1.ComponentType; iconColor?: string; title: string; content: React$1.ReactNode; action?: () => void; actionNode?: React$1.ReactNode; actionLabel?: string; className?: string; } declare const EmptyState: React$1.FunctionComponent; interface ErrorPageProps extends OuiaComponentProps { action: () => void; actionLabel: string; pageHeader: string; title: string; description: string; } interface ErrorPageState { hasError: boolean; error?: any; } declare class ErrorBoundaryPage extends React$1.Component { constructor(props: Readonly); executeAction: () => void; static getDerivedStateFromError(error: any): ErrorPageState; render(): React$1.ReactNode; } interface EnvDetectorProps { onEnvironment: ReadonlyArray | Environment; currentEnvironment: Environment; } declare const EnvDetector: React$1.FunctionComponent>; interface InsightsBetaDetectorProps extends Omit { insights: InsightsType; } declare const InsightsEnvDetector: React$1.FunctionComponent>; interface CheckboxProps extends Omit { name: string; isRequired?: boolean; ouiaId?: string; } declare const Checkbox: React$1.FunctionComponent; interface FormProps extends OuiaComponentProps, FormProps$1 { } declare const Form: React$1.FunctionComponent; interface FormSelectProps extends OuiaComponentProps, Omit { id: string; name: string; isRequired?: boolean; } declare const FormSelect: React$1.FunctionComponent; interface FormTextProps extends Omit { id: string; name: string; isRequired?: boolean; ouiaId?: string; } declare const FormText: React$1.FunctionComponent; interface FormTextAreaProps extends OuiaComponentProps, Omit { id: string; name: string; } declare const FormTextArea: React$1.FunctionComponent; interface FormTextInputProps extends Omit { id: string; name: string; hint?: string; ouiaId?: string; } declare const FormTextInput: React$1.FunctionComponent; interface SwitchProps extends OuiaComponentProps, Omit { id: string; name: string; isRequired?: boolean; labelOn?: string; } declare const Switch: React$1.FunctionComponent; interface SectionProps extends OuiaComponentProps { className?: string; style?: React$1.CSSProperties; } declare const Section: React$1.FunctionComponent; interface ActionModalError { title: string; description: React$1.ReactNode | string; } interface ActionModalProps extends Pick { isOpen: boolean; isPerformingAction: boolean; title: string; content: React$1.ReactNode | string; error?: ActionModalError; onClose: (actionPerformed: boolean) => void; onAction: () => boolean | Promise; actionButtonTitle: string; actionButtonVariant: ButtonVariant; actionButtonDisabled?: boolean; actionButtonHidden?: boolean; cancelButtonTitle?: string; cancelButtonVariant?: ButtonVariant; } declare const ActionModal: React$1.FunctionComponent; declare type ChangedProps$1 = 'isPerformingAction' | 'onAction'; declare type InheritedProps$1 = 'isOpen' | 'title' | 'content' | 'onClose' | 'error' | 'variant'; declare type DeleteModalProps = Omit, ChangedProps$1> & { isDeleting: boolean; onDelete: () => boolean | Promise; }; declare const DeleteModal: React$1.FunctionComponent; declare type ChangedProps = 'isPerformingAction' | 'onAction'; declare type InheritedProps = 'isOpen' | 'title' | 'content' | 'onClose' | 'error' | 'actionButtonDisabled' | 'variant' | 'titleIconVariant'; declare type SaveModalProps = Omit, ChangedProps> & { isSaving: boolean; onSave: () => boolean | Promise; }; declare const SaveModal: React$1.FunctionComponent; declare type BreadcrumbLinkItemProps = Omit & OuiaComponentProps; declare const BreadcrumbLinkItem: React$1.FunctionComponent; declare const localUrl: (path: string, isBeta: boolean) => string; declare type UseStateType = typeof useState; declare type UseDebouncedStateReturn = [T, Dispatch>, T, () => boolean | null]; declare type UseDebouncedStateType = (initialValue: T, ms: number, useStateHook?: UseStateType) => UseDebouncedStateReturn; declare const useDebouncedState: (initialValue: T, ms: number, useStateHook?: typeof useState | undefined) => UseDebouncedStateReturn; declare const useFilters: >(initEnum: FilterColumn, debounce?: number, initUseStateFactory?: ((column: EnumElement) => typeof useState | undefined) | undefined) => { clearFilter: ClearFilters; filters: Filters; setFilters: SetFilters; debouncedFilters: Filters; }; interface FilterColumnMetadataOptionsBase { exclude?: Array; default?: T; exclusive?: boolean; items: Array<{ value: string; chipValue?: string; label: ReactNode; }>; } interface FilterColumnMetadataOptionsSingleValue extends FilterColumnMetadataOptionsBase { exclusive?: true; } interface FilterColumnMetadataOptionsMultipleValue extends FilterColumnMetadataOptionsBase> { exclusive?: false; } interface FilterColumnMetadata { label: string; placeholder: string; options?: FilterColumnMetadataOptionsSingleValue | FilterColumnMetadataOptionsMultipleValue; } declare type OptionalColumnsMetada> = OptionalFilterBase; declare type ColumnsMetada> = FilterBase; declare const usePrimaryToolbarFilterConfig: >(initEnum: FilterColumn, filters: Filters, setFilters: SetFilters, clearFilters: ClearFilters, meta: OptionalColumnsMetada, deleteTitle?: "Reset filters" | undefined) => { filterConfig: { items: { label: string; type: string; filterValues: { id: string; value: FilterContent; placeholder: string; onChange: (_event: any, value: string | Array) => void; items: { value: string; chipValue?: string | undefined; label: ReactNode; }[] | undefined; }; }[]; }; activeFiltersConfig: { filters: FilterChipsFilter[]; onDelete: (_event: any, rawFilterConfigs: any[]) => void; }; deleteTitle: "Reset filters" | undefined; }; declare type UseResolvedPromiseValueReturn = T | undefined; declare const usePromiseState: (promise: Promise) => UseResolvedPromiseValueReturn; interface UseSortReturn { sortBy: Sort | undefined; onSort: OnSortHandlerType; } declare const useSort: (defaultSort?: Sort | undefined) => UseSortReturn; declare type AsyncFunction = () => (Promise | unknown); declare const useSyncInterval: (ms: number, callback: AsyncFunction, callImmediately?: boolean) => void; declare type UseUrlStateResponse = [T | undefined, Dispatch>]; declare type Serializer = (value: T | undefined) => string | undefined; declare type Deserializer = (value: string | undefined) => T | undefined; declare type UseUrlStateType = (name: string, serializer: Serializer, deserializer: Deserializer, initialValue?: T) => UseUrlStateResponse; declare const useUrlState: (name: string, serializer: Serializer, deserializer: Deserializer, initialValue?: T | undefined) => UseUrlStateResponse; declare type UseUrlStateStringType = (name: string, initialValue?: string) => UseUrlStateResponse; declare const useUrlStateString: (name: string, initialValue?: string | undefined) => UseUrlStateResponse; declare type Unpacked = T extends (infer U)[] ? U : T; declare const useUrlStateExclusiveOptions: (name: string, options?: AT | undefined, defaultValue?: Unpacked | undefined) => UseUrlStateResponse>; declare const useUrlStateMultipleOptions: (name: string, options?: T[] | undefined, defaultValue?: T[] | undefined) => UseUrlStateResponse; declare type FeatureFlagCallback = () => T; declare type FeatureFlagSignature = { (resolver: () => boolean, ifTrue: FeatureFlagCallback, ifFalse?: FeatureFlagCallback): T | undefined; (resolver: () => boolean, ifTrue: FeatureFlagCallback | undefined, ifFalse: FeatureFlagCallback): T | undefined; }; declare const useFeatureFlag: FeatureFlagSignature; declare type EnvironmentFlagSignature = { (currentEnvironment: Environment, targetEnvironments: Environment | ReadonlyArray, ifTrue: FeatureFlagCallback, ifFalse?: FeatureFlagCallback): T | undefined; (currentEnvironment: Environment, targetEnvironments: Environment | ReadonlyArray, ifTrue: FeatureFlagCallback | undefined, ifFalse: FeatureFlagCallback): T | undefined; }; declare const useEnvironmentFlag: EnvironmentFlagSignature; declare type InsightsEnvironmentFlagSignature = { (insights: InsightsType, targetEnvironments: Environment | ReadonlyArray, ifTrue: FeatureFlagCallback, ifFalse?: FeatureFlagCallback): T | undefined; (insights: InsightsType, targetEnvironments: Environment | ReadonlyArray, ifTrue: FeatureFlagCallback | undefined, ifFalse: FeatureFlagCallback): T | undefined; }; declare const useInsightsEnvironmentFlag: InsightsEnvironmentFlagSignature; declare const restoreStore: () => void; declare const initStore: >(initialState?: State | undefined, reducer?: Reducer | undefined, ...middleware: Middleware[]) => any; declare const getStore: () => any; export { ActionModal, ActionModalError, ActionModalProps, AppSkeleton, BetaDetector, BetaEnvironment, BetaIf, BetaIfNot, BreadcrumbLinkItem, Checkbox, ClearFilterElement, ClearFilters, ColumnsMetada, DeleteModal, DeleteModalProps, Deserializer, Direction, EmailOptIn, EmptyState, EmptyStateSectionProps, EnumElement, EnvDetector, Environment, Environments, ErrorBoundaryPage, Exporter, ExporterCsv, ExporterHeaders, ExporterJson, ExporterType, FeatureFlagCallback, FeatureFlagSignature, Filter, FilterBase, FilterColumnMetadata, FilterContent, Filters, Form, FormSelect, FormText, FormTextArea, FormTextInput, HasToString, Headers, ImmutableContainerSet, ImmutableContainerSetMode, InsightsBetaDetector, InsightsEmailOptIn, InsightsEnvDetector, InsightsType, NonBetaEnvironment, NotificationType, OnSortHandlerType, Operator, OptionalColumnsMetada, OptionalFilterBase, OuiaComponentProps, Page, Rbac, RbacPermission, RbacPermissionsBuilder, RenderIf, RenderIfFalse, RenderIfProps, RenderIfTrue, RenderIfTrueFalse, SaveModal, SaveModalProps, Section, SemiPartial, Serializer, SetFilters, Sort, StandardFilterEnum, Switch, UseDebouncedStateType, UseSortReturn, UseUrlStateResponse, UseUrlStateStringType, UseUrlStateType, addDangerNotification, addInfoNotification, addNotification, addSuccessNotification, addWarningNotification, arrayValue, clearNotifications, createFetchingClient, exporterTypeFromString, fetchRBAC, fromUtc, getBaseName, getInsights, getInsightsEnvironment, getOuiaPropsFactory, getStore, initStore, join, joinClasses, localUrl, ouiaIdConcat, rbacApi, restoreStore, setOuiaPage, stringValue, toUtc, useDebouncedState, useEnvironmentFlag, useFeatureFlag, useFilters, useInsightsEnvironmentFlag, usePrimaryToolbarFilterConfig, usePromiseState, useSort, useSyncInterval, useTransformQueryResponse, useUrlState, useUrlStateExclusiveOptions, useUrlStateMultipleOptions, useUrlStateString, waitForInsights, withoutOuiaProps };