UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

60 lines (59 loc) 2.27 kB
/** * Copyright IBM Corp. 2024, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { ReactNode, type JSX } from 'react'; export interface FeatureFlagsProps { children?: ReactNode; flags?: Record<string, boolean>; defaultPortalTargetBody?: boolean; enableDatagridUseInlineEdit?: boolean; enableDatagridUseEditableCell?: boolean; enableDatagridUseCustomizeColumns?: boolean; enableSidepanelResizer?: boolean; enableTestFlagA?: boolean; enableTestFlagB?: boolean; } /** * Our FeatureFlagContext is used alongside the FeatureFlags component to enable * or disable feature flags in a given React tree */ declare const FeatureFlagContext: React.Context<any>; /** * Supports an object of feature flag values with the `flags` prop, merging them * along with the current `FeatureFlagContext` to provide consumers to check if * a feature flag is enabled or disabled in a given React tree */ declare function FeatureFlags({ children, flags, defaultPortalTargetBody, enableDatagridUseInlineEdit, enableDatagridUseEditableCell, enableDatagridUseCustomizeColumns, enableSidepanelResizer, enableTestFlagA, enableTestFlagB, }: FeatureFlagsProps): JSX.Element; declare namespace FeatureFlags { var propTypes: { children: any; /** * Provide the feature flags to enabled or disabled in the current React tree */ defaultPortalTargetBody: any; enableDatagridUseCustomizeColumns: any; enableDatagridUseEditableCell: any; enableDatagridUseInlineEdit: any; enableSidepanelResizer: any; enableTestFlagA: any; enableTestFlagB: any; flags: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any; }; } /** * Access whether a given flag is enabled or disabled in a given * FeatureFlagContext * * @returns {boolean} */ declare function useFeatureFlag(flag: any): any; /** * Access all feature flag information for the given FeatureFlagContext * * @returns {FeatureFlagScope} */ declare function useFeatureFlags(): any; export { FeatureFlags, FeatureFlagContext, useFeatureFlags, useFeatureFlag };