UNPKG

isa-auth-core

Version:
44 lines (43 loc) 1.47 kB
export type AuthButtonType = 'rect' | 'rounded' | 'circle' | 'link' | 'brand'; export type ProviderType = 'default' | 'google' | 'apple' | 'kakao' | 'line' | 'naver' | 'facebook' | 'twitter' | 'wechat'; export interface LoginButtonConfig { id: string; style?: Partial<CSSStyleDeclaration>; text?: string; icon?: string; fullWidth?: boolean; } export interface LoginButtonProps { type: AuthButtonType; provider: ProviderType; action: Function; config: LoginButtonConfig; } /** * @description provider 타입을 좀 더 구체적으로 해야하나? * core package에서는 단순한 컴포넌트 정보를 담은 json인데 여기에 action이 필요한가? * 외부에서 주입하는 props는 그러려니하지만 기본적인 공통 props는 좀 더 명확히 정의 내릴 수 있지않을까? */ declare class LoginButton { readonly type: AuthButtonType; readonly provider: ProviderType; readonly action: Function; readonly config: LoginButtonConfig; constructor(props: LoginButtonProps); private getDefaultText; private getDefaultStyle; private mergeStyles; getButtonClass(): string; toJSON(): { id: string; type: AuthButtonType; provider: ProviderType; icon: string; text: string; style: Partial<CSSStyleDeclaration>; fullWidth: boolean; className: string; onClick: Function; }; } export default LoginButton;