212 lines
8.2 KiB
Markdown
212 lines
8.2 KiB
Markdown
|
## API Report File for "@fluentui/foundation-legacy"
|
||
|
|
||
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||
|
|
||
|
```ts
|
||
|
|
||
|
import { ISchemeNames } from '@fluentui/style-utilities';
|
||
|
import { IStyle } from '@fluentui/style-utilities';
|
||
|
import { IStyleSetBase } from '@fluentui/style-utilities';
|
||
|
import { ITheme } from '@fluentui/style-utilities';
|
||
|
import { styled as legacyStyled } from '@fluentui/utilities';
|
||
|
import * as React_2 from 'react';
|
||
|
|
||
|
// @public
|
||
|
export function createComponent<TComponentProps extends ValidProps, TTokens, TStyleSet extends IStyleSetBase, TViewProps extends TComponentProps = TComponentProps, TStatics = {}>(view: IViewComponent<TViewProps>, options?: IComponentOptions<TComponentProps, TTokens, TStyleSet, TViewProps, TStatics>): React_2.FunctionComponent<TComponentProps> & TStatics;
|
||
|
|
||
|
// @public
|
||
|
export function createFactory<TProps extends ValidProps, TShorthandProp extends ValidShorthand = never>(DefaultComponent: React_2.ComponentType<TProps>, options?: IFactoryOptions<TProps>): ISlotFactory<TProps, TShorthandProp>;
|
||
|
|
||
|
// @public
|
||
|
export type ExtractProps<TUnion> = TUnion extends ISlotProp<infer TProps> ? TProps : never;
|
||
|
|
||
|
// @public
|
||
|
export type ExtractShorthand<TUnion> = TUnion extends boolean ? boolean : TUnion extends number ? number : TUnion extends string ? string : never;
|
||
|
|
||
|
// @public
|
||
|
export function getControlledDerivedProps<TProps, TProp extends keyof TProps>(props: Readonly<TProps>, propName: TProp, derivedValue: TProps[TProp]): TProps[TProp];
|
||
|
|
||
|
// @public
|
||
|
export function getSlots<TComponentProps extends ISlottableProps<TComponentSlots>, TComponentSlots>(userProps: TComponentProps, slots: ISlotDefinition<Required<TComponentSlots>>): ISlots<Required<TComponentSlots>>;
|
||
|
|
||
|
// @public
|
||
|
export type IComponent<TComponentProps, TTokens, TStyleSet extends IStyleSetBase, TViewProps = TComponentProps, TStatics = {}> = Required<IComponentOptions<TComponentProps, TTokens, TStyleSet, TViewProps, TStatics>> & {
|
||
|
view: IViewComponent<TViewProps>;
|
||
|
};
|
||
|
|
||
|
// @public
|
||
|
export interface IComponentOptions<TComponentProps, TTokens, TStyleSet extends IStyleSetBase, TViewProps = TComponentProps, TStatics = {}> {
|
||
|
displayName?: string;
|
||
|
factoryOptions?: IFactoryOptions<TComponentProps>;
|
||
|
fields?: string[];
|
||
|
state?: IStateComponentType<TComponentProps, TViewProps>;
|
||
|
statics?: TStatics;
|
||
|
styles?: IStylesFunctionOrObject<TViewProps, TTokens, TStyleSet>;
|
||
|
tokens?: ITokenFunctionOrObject<TViewProps, TTokens>;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type IComponentStyles<TSlots> = {
|
||
|
[key in keyof TSlots]?: IStyle;
|
||
|
};
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IControlledStateOptions<TProps, TProp extends keyof TProps, TDefaultProp extends keyof TProps> {
|
||
|
// (undocumented)
|
||
|
defaultPropName?: TDefaultProp;
|
||
|
// (undocumented)
|
||
|
defaultPropValue?: TProps[TProp];
|
||
|
}
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export type ICustomizationProps<TViewProps, TTokens, TStyleSet extends IStyleSetBase> = IStyleableComponentProps<TViewProps, TTokens, TStyleSet> & Required<Pick<IStyleableComponentProps<TViewProps, TTokens, TStyleSet>, 'theme'>>;
|
||
|
|
||
|
// @public
|
||
|
export interface IDefaultSlotProps<TSlots> {
|
||
|
// (undocumented)
|
||
|
_defaultStyles: IComponentStyles<TSlots>;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export interface IFactoryOptions<TProps> {
|
||
|
defaultProp?: keyof TProps | 'children';
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type IHTMLElementSlot<TElement extends keyof JSX.IntrinsicElements> = ISlotProp<JSX.IntrinsicElements[TElement]>;
|
||
|
|
||
|
// @public
|
||
|
export type IHTMLSlot = ISlotProp<React_2.DetailedHTMLProps<React_2.HTMLAttributes<any>, any>>;
|
||
|
|
||
|
// @public
|
||
|
export interface IProcessedSlotProps {
|
||
|
// (undocumented)
|
||
|
className?: string;
|
||
|
}
|
||
|
|
||
|
// @public @deprecated
|
||
|
export type IPropsWithChildren<TProps> = React_2.PropsWithChildren<TProps>;
|
||
|
|
||
|
// @public
|
||
|
export interface ISlot<TProps> {
|
||
|
// (undocumented)
|
||
|
(componentProps: React_2.PropsWithChildren<TProps> | undefined | null): ReturnType<React_2.FunctionComponent>;
|
||
|
// (undocumented)
|
||
|
isSlot?: boolean;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export interface ISlotCreator<TProps extends ValidProps, TShorthandProp extends ValidShorthand> {
|
||
|
// (undocumented)
|
||
|
create?: ISlotFactory<TProps, TShorthandProp>;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type ISlotDefinition<TSlots> = {
|
||
|
[slot in keyof TSlots]: React_2.ElementType<ExtractProps<TSlots[slot]>>;
|
||
|
};
|
||
|
|
||
|
// @public
|
||
|
export type ISlotFactory<TProps extends ValidProps, TShorthandProp extends ValidShorthand> = (componentProps: TProps & IProcessedSlotProps, userProps: ISlotProp<TProps, TShorthandProp>, slotOptions: ISlotOptions<TProps> | undefined, defaultStyles: IStyle, theme?: ITheme) => ReturnType<React_2.FunctionComponent<TProps>>;
|
||
|
|
||
|
// @public
|
||
|
export interface ISlotOptions<TProps> {
|
||
|
// (undocumented)
|
||
|
component?: React_2.ElementType<TProps>;
|
||
|
// (undocumented)
|
||
|
render?: ISlotRender<TProps>;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type ISlotProp<TProps extends ValidProps, TShorthandProp extends ValidShorthand = never> = TShorthandProp | TProps;
|
||
|
|
||
|
// @public
|
||
|
export type ISlotRender<TProps> = (props: React_2.PropsWithChildren<TProps>, defaultComponent: React_2.ComponentType<TProps>) => ReturnType<React_2.FunctionComponent<TProps>>;
|
||
|
|
||
|
// @public
|
||
|
export type ISlots<TSlots> = {
|
||
|
[slot in keyof TSlots]: ISlot<ExtractProps<TSlots[slot]>>;
|
||
|
};
|
||
|
|
||
|
// @public
|
||
|
export type ISlottableComponentType<TProps extends ValidProps, TShorthandProp extends ValidShorthand> = React_2.ComponentType<TProps> & ISlotCreator<TProps, TShorthandProp>;
|
||
|
|
||
|
// @public
|
||
|
export type ISlottableProps<TSlots> = TSlots & {
|
||
|
slots?: {
|
||
|
[key in keyof TSlots]+?: ISlotOptions<ExtractProps<TSlots[key]>>;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
// @public
|
||
|
export type ISlottableReactType<TProps extends ValidProps, TShorthandProp extends ValidShorthand> = React_2.ElementType<TProps> & ISlotCreator<TProps, TShorthandProp>;
|
||
|
|
||
|
// @public
|
||
|
export type IStateComponentType<TComponentProps, TViewProps> = (props: Readonly<TComponentProps>) => TViewProps;
|
||
|
|
||
|
// @public
|
||
|
export interface IStyleableComponentProps<TViewProps, TTokens, TStyleSet extends IStyleSetBase> {
|
||
|
// (undocumented)
|
||
|
className?: string;
|
||
|
// (undocumented)
|
||
|
styles?: IStylesFunctionOrObject<TViewProps, TTokens, TStyleSet>;
|
||
|
// (undocumented)
|
||
|
theme?: ITheme;
|
||
|
// (undocumented)
|
||
|
tokens?: ITokenFunctionOrObject<TViewProps, TTokens>;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type IStylesFunction<TViewProps, TTokens, TStyleSet extends IStyleSetBase> = (props: TViewProps, theme: ITheme, tokens: TTokens) => TStyleSet;
|
||
|
|
||
|
// @public
|
||
|
export type IStylesFunctionOrObject<TViewProps, TTokens, TStyleSet extends IStyleSetBase> = IStylesFunction<TViewProps, TTokens, TStyleSet> | TStyleSet;
|
||
|
|
||
|
// @public (undocumented)
|
||
|
export interface IThemeProviderProps {
|
||
|
// (undocumented)
|
||
|
scheme?: ISchemeNames;
|
||
|
// (undocumented)
|
||
|
theme?: ITheme;
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type IToken<TViewProps, TTokens> = ITokenBase<TViewProps, TTokens> | ITokenBaseArray<TViewProps, TTokens>;
|
||
|
|
||
|
// @public
|
||
|
export type ITokenBase<TViewProps, TTokens> = ITokenFunctionOrObject<TViewProps, TTokens> | false | null | undefined;
|
||
|
|
||
|
// @public
|
||
|
export interface ITokenBaseArray<TViewProps, TTokens> extends Array<IToken<TViewProps, TTokens>> {
|
||
|
}
|
||
|
|
||
|
// @public
|
||
|
export type ITokenFunction<TViewProps, TTokens> = (props: TViewProps, theme: ITheme) => IToken<TViewProps, TTokens>;
|
||
|
|
||
|
// @public
|
||
|
export type ITokenFunctionOrObject<TViewProps, TTokens> = ITokenFunction<TViewProps, TTokens> | TTokens;
|
||
|
|
||
|
// @public
|
||
|
export type IViewComponent<TViewProps> = (props: React_2.PropsWithChildren<TViewProps>) => ReturnType<React_2.FunctionComponent>;
|
||
|
|
||
|
export { legacyStyled }
|
||
|
|
||
|
// @public @deprecated
|
||
|
export const ThemeProvider: React_2.FunctionComponent<IThemeProviderProps>;
|
||
|
|
||
|
// @public
|
||
|
export function useControlledState<TProps, TProp extends keyof TProps, TDefaultProp extends keyof TProps>(props: Readonly<TProps>, propName: TProp, options?: IControlledStateOptions<TProps, TProp, TDefaultProp>): [TProps[TProp] | undefined, React_2.Dispatch<React_2.SetStateAction<TProps[TProp]>>];
|
||
|
|
||
|
// @public
|
||
|
export type ValidProps = object;
|
||
|
|
||
|
// @public
|
||
|
export type ValidShorthand = string | number | boolean;
|
||
|
|
||
|
// @public
|
||
|
export function withSlots<P extends {}>(type: ISlot<P> | React_2.FunctionComponent<P> | string, props?: (React_2.Attributes & P) | null, ...children: React_2.ReactNode[]): ReturnType<React_2.FunctionComponent<P>>;
|
||
|
|
||
|
// (No @packageDocumentation comment for this package)
|
||
|
|
||
|
```
|