segmentio / chrome-sidebar

Easiest way to embed an iframe as a chrome extension
https://open.segment.com
227 stars 58 forks source link

Here is the Typescript module definition if anyone is interested #36

Open louisremi opened 2 years ago

louisremi commented 2 years ago

Not issuing a PR as the project seems long dead

declare module 'chrome-sidebar' {
    import React, { ReactNode } from 'react';

    export interface LifecycleArgs {
        mask: React.LegacyRef,
        frame: React.LegacyRef
    }

    export interface FrameProps {
        url: string;
        delay?: number;
        maskClassName?: string;
        maskStyle?: React.CSSProperties;
        containerClassName?: string;
        containerStyle?: React.CSSProperties;
        iframeClassName?: string;
        iframeStyle?: React.CSSProperties;
        children?: ReactNode;
        containerChildren?: ReactNode;
        onMount?: (LifecycleArgs) => void;
        onUnmount?: (LifecycleArgs) => void;
        onLoad?: (LifecycleArgs) => void
    }

    export const Frame: React.SFC<FrameProps> & {
        isReady: () => boolean;
        toggle: () => void;
    }
};