2.0.12 • Published 6 months ago

@types/react-albus v2.0.12

Weekly downloads
3,874
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-albus

Summary

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

Details

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

index.d.ts

// Type definitions for react-albus 2.0
// Project: https://github.com/americanexpress/react-albus#readme
// Definitions by: Sindre Seppola <https://github.com/sseppola>
//                 Conrad Reuter <https://github.com/conradreuter>
//                 Jonas Kugelmann <https://github.com/kuirak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import * as React from "react";
import { History } from "history";

export interface StepObject {
    id: string;
}

export interface WizardContext {
    step: StepObject;
    steps: StepObject[];
    history: History;
    next: () => void;
    previous: () => void;
    go: (n: number) => void;
    push: (id?: string) => void;
    replace: (id?: string) => void;
}

export interface WizardComponentProps {
    wizard: WizardContext;
}

export function withWizard<P>(
    component: React.ComponentType<P & WizardComponentProps>
): React.ComponentType<P>;

export interface WizardProps {
    onNext?: ((wizard: WizardContext) => void) | undefined;
    render?: ((wizard: WizardContext) => React.ReactNode) | undefined;
    history?: History | undefined;
    basename?: string | undefined;
}

export const Wizard: React.ComponentType<WizardProps>;

export type WizardContextRenderProps =
    | { render?: ((wizard: WizardContext) => React.ReactNode) | undefined }
    | { children: ((wizard: WizardContext) => React.ReactNode) | React.ReactNode };

export const WithWizard: React.ComponentType<WizardContextRenderProps>;

export interface StepsProps {
    children: NonNullable<React.ReactNode>;
    step?: StepObject | undefined;
}

export const Steps: React.ComponentType<StepsProps>;

export type StepProps = StepObject & WizardContextRenderProps;

/**
 * In addition to id, any additional props added to <Step> will be available on each step object.
 * This can be used to add names, descriptions, or other metadata to each step.
 * To use this feature globally in your project you need to augment the StepObject
 * @example
 * declare module "react-albus" {
 *   interface StepObject {
 *     propName: string;
 *   }
 * }
 */
export const Step: React.ComponentType<StepProps>;

Additional Details

Credits

These definitions were written by Sindre Seppola, Conrad Reuter, and Jonas Kugelmann.

2.0.11

7 months ago

2.0.12

6 months ago

2.0.10

8 months ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago