Skip to content

Commit

Permalink
changed typing declarations to match common-types.ts file (#3094)
Browse files Browse the repository at this point in the history
  • Loading branch information
sambocharov authored Nov 21, 2023
1 parent 6595ebb commit b7b9f27
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/bpk-component-info-banner/src/common-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,32 @@
import type { FunctionComponent, ReactNode } from 'react';

export declare const ALERT_TYPES: {
readonly PRIMARY: 'primary';
readonly SUCCESS: 'success';
readonly WARN: 'warn';
readonly ERROR: 'error';
readonly NEUTRAL: 'neutral';
readonly SUCCESS: 'success',
readonly WARNING: 'warning',
readonly ERROR: 'error',
readonly INFO: 'info',
};
export declare const STYLE_TYPES: {
readonly DEFAULT: 'default',
readonly ON_CONTRAST: 'onContrast',
};
export type AlertTypeValue = (typeof ALERT_TYPES)[keyof typeof ALERT_TYPES];
export type StyleTypeValue = (typeof STYLE_TYPES)[keyof typeof STYLE_TYPES];
export type CommonProps = {
type: AlertTypeValue;
type?: AlertTypeValue;
message: ReactNode | string;
animateOnEnter?: boolean;
animateOnLeave?: boolean;
show?: boolean;
bannerClassName?: string | null;
icon?: FunctionComponent<any> | null;
style?: StyleTypeValue;
[rest: string]: any;
};
export type OnExpandToggleHandler =
| ((expanded: boolean) => void)
| null
| undefined;
export type ExpandableBannerAction = { title: string, callback: () => void } | null | undefined;
export type OnDismissHandler = (() => void) | null | undefined;
export type OnHideHandler = (() => void) | null | undefined;

0 comments on commit b7b9f27

Please sign in to comment.