@towercg2/react
Version:
React helper code for TowerCG2.
21 lines (20 loc) • 1.09 kB
TypeScript
/// <reference types="react" />
import * as React from "react";
import { Client, RosterPluginState, TickPluginState } from "@towercg2/client";
export interface PluginStateProviderProps {
client: Client;
}
export interface PluginStateProviderState<TPluginState extends object> {
pluginState: TPluginState | null;
}
export declare type PluginStateContextProviderClass<TPluginState extends object> = {
new (props: any): React.Component<PluginStateProviderProps, PluginStateProviderState<TPluginState>>;
};
export declare type PluginStateContextConsumer<TPluginState extends object> = React.Consumer<TPluginState | null>;
export interface PluginStateContext<TPluginState extends object> {
Provider: PluginStateContextProviderClass<TPluginState>;
Consumer: PluginStateContextConsumer<TPluginState>;
}
export declare function buildPluginStateProvider<TPluginState extends object>(pluginName: string): PluginStateContext<TPluginState>;
export declare const TickContext: PluginStateContext<TickPluginState>;
export declare const RosterContext: PluginStateContext<RosterPluginState>;