@carbon/ibm-products
Version:
Carbon for IBM Products
41 lines (40 loc) • 1.43 kB
TypeScript
/**
* Copyright IBM Corp. 2024, 2024
*
* 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 from 'react';
/**
* 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 individual feature flag values as props, 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, ...newFlags }: {
[x: string]: any;
children: any;
flags?: {} | undefined;
}): React.JSX.Element;
declare namespace FeatureFlags {
var propTypes: {
children: any;
/**
* Provide the feature flags to enabled or disabled in the current React tree, this has been deprecated. as we are going to pass individual boolean props for each flag.
*/
flags: any;
};
}
/**
* Access whether a given flag is enabled or disabled in a given FeatureFlagContext
*/
declare function useFeatureFlag(flag: string): boolean;
/**
* Access all feature flag information for the given FeatureFlagContext
*/
declare function useFeatureFlags(): any;
export { FeatureFlags, FeatureFlagContext, useFeatureFlags, useFeatureFlag };