Skip to content

Latest commit

 

History

History
212 lines (161 loc) · 8.14 KB

foundation-legacy.api.md

File metadata and controls

212 lines (161 loc) · 8.14 KB

API Report File for "@fluentui/foundation-legacy"

Do not edit this file. It is a report generated by API Extractor.

import { ISchemeNames } from '@fluentui/style-utilities';
import { IStyle } from '@fluentui/style-utilities';
import { IStyleSet } from '@fluentui/style-utilities';
import { ITheme } from '@fluentui/style-utilities';
import { styled as legacyStyled } from '@uifabric/utilities';
import * as React from 'react';

// @public
export function createComponent<TComponentProps extends ValidProps, TTokens, TStyleSet extends IStyleSet<TStyleSet>, TViewProps extends TComponentProps = TComponentProps, TStatics = {}>(view: IViewComponent<TViewProps>, options?: IComponentOptions<TComponentProps, TTokens, TStyleSet, TViewProps, TStatics>): React.FunctionComponent<TComponentProps> & TStatics;

// @public
export function createFactory<TProps extends ValidProps, TShorthandProp extends ValidShorthand = never>(DefaultComponent: React.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 IStyleSet<TStyleSet>, TViewProps = TComponentProps, TStatics = {}> = Required<IComponentOptions<TComponentProps, TTokens, TStyleSet, TViewProps, TStatics>> & {
    view: IViewComponent<TViewProps>;
};

// @public
export interface IComponentOptions<TComponentProps, TTokens, TStyleSet extends IStyleSet<TStyleSet>, 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 IStyleSet<TStyleSet>> = 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.DetailedHTMLProps<React.HTMLAttributes<any>, any>>;

// @public
export interface IProcessedSlotProps {
    // (undocumented)
    className?: string;
}

// @public @deprecated
export type IPropsWithChildren<TProps> = React.PropsWithChildren<TProps>;

// @public
export interface ISlot<TProps> {
    // (undocumented)
    (componentProps: React.PropsWithChildren<TProps> | undefined | null): ReturnType<React.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.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.FunctionComponent<TProps>>;

// @public
export interface ISlotOptions<TProps> {
    // (undocumented)
    component?: React.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.PropsWithChildren<TProps>, defaultComponent: React.ComponentType<TProps>) => ReturnType<React.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.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.ElementType<TProps> & ISlotCreator<TProps, TShorthandProp>;

// @public
export type IStateComponentType<TComponentProps, TViewProps> = (props: Readonly<TComponentProps>) => TViewProps;

// @public
export interface IStyleableComponentProps<TViewProps, TTokens, TStyleSet extends IStyleSet<TStyleSet>> {
    // (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 IStyleSet<TStyleSet>> = (props: TViewProps, theme: ITheme, tokens: TTokens) => TStyleSet;

// @public
export type IStylesFunctionOrObject<TViewProps, TTokens, TStyleSet extends IStyleSet<TStyleSet>> = 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.PropsWithChildren<TViewProps>) => ReturnType<React.FunctionComponent>;

export { legacyStyled }

// @public
export const ThemeProvider: React.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.Dispatch<React.SetStateAction<TProps[TProp]>>];

// @public
export type ValidProps = object;

// @public
export type ValidShorthand = string | number | boolean;

// @public
export function withSlots<P>(type: ISlot<P> | React.FunctionComponent<P> | string, props?: (React.Attributes & P) | null, ...children: React.ReactNode[]): ReturnType<React.FunctionComponent<P>>;


// (No @packageDocumentation comment for this package)