Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Remove ComponentProps and replace with inline union type
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong committed Jun 29, 2020
1 parent f4874d3 commit 4f5adeb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { PropType } from "./Types";
* Base class for components.
*/

export type ComponentProps<P> = P | false;

export type ComponentSchemaProp<T> = {
default?: T;
type: PropType<T>;
Expand All @@ -18,7 +16,7 @@ export type ComponentSchema = {
export class Component<P> {
static schema: ComponentSchema;
static isComponent: true;
constructor(props?: ComponentProps<P>);
constructor(props?: P | false);
copy(source: this): this;
clone(): this;
reset(): void;
Expand All @@ -28,5 +26,5 @@ export class Component<P> {
export interface ComponentConstructor<P, C extends Component<P>> {
schema: ComponentSchema;
isComponent: true;
new (props?: ComponentProps<P>): C;
new (props?: P | false): C;
}

0 comments on commit 4f5adeb

Please sign in to comment.