3.1.4 • Published 6 months ago

@types/react-codesandboxer v3.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-codesandboxer

Summary

This package contains type definitions for react-codesandboxer (https://github.com/codesandbox/codesandboxer#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-codesandboxer.

index.d.ts

// Type definitions for react-codesandboxer 3.1
// Project: https://github.com/codesandbox/codesandboxer#readme
// Definitions by: Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as React from 'react';

export interface GitInfo {
    account: string;
    repository: string;
    branch?: string | undefined;
    host: 'bitbucket' | 'github';
}

export interface Files {
    [key: string]: { content: string };
}

export interface Package {
    name: string;
    version: string;
    dependencies: {
        [key: string]: string;
    };
    devDependencies: {
        [key: string]: string;
    };
    peerDependencies: {
        [key: string]: string;
    };
}

export type ImportReplacement = [string, string];

export interface Error {
    name: string;
    description?: string | undefined;
    content?: string | undefined;
}

export interface State {
    parameters: string;
    isLoading: boolean;
    isDeploying: boolean;
    sandboxId?: string | undefined;
    sandboxUrl?: string | undefined;
    deployPromise?: Promise<any> | undefined;
    files?: Files | undefined;
    error?: Error | undefined;
    fileName: string;
}

export interface Props {
    examplePath: string;
    name?: string | undefined;
    gitInfo: GitInfo;
    example?: string | Promise<string> | undefined;
    pkgJSON?: Package | string | Promise<Package | string> | undefined;
    importReplacements?: ImportReplacement[] | undefined;
    dependencies?: { [key: string]: string } | undefined;
    skipRedirect?: boolean | undefined;
    ignoreInternalImports?: boolean | undefined;
    preload?: boolean | undefined;
    autoDeploy?: boolean | undefined;
    onLoadComplete?: ((
        arg: { parameters: string; files: Files } | { error: any }
    ) => unknown) | undefined;
    afterDeploy?: ((sandboxUrl: string, sandboxId: string) => unknown) | undefined;
    afterDeployError?: ((error: Error) => unknown) | undefined;
    providedFiles?: Files | undefined;
    children: (obj: {
        isLoading: boolean;
        files?: Files | undefined;
        sandboxId?: string | undefined;
        sandboxUrl?: string | undefined;
    }) => React.ReactNode;
    style?: object | undefined;
    extensions?: string[] | undefined;
    template?: 'create-react-app' | 'create-react-app-typescript' | 'vue-cli' | undefined;
}

export default class CodeSandboxDeployer extends React.Component<Props, State> {}

Additional Details

  • Last updated: Thu, 08 Jul 2021 20:20:31 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Nathan Bierema.