Skip to content

Commit

Permalink
fixup! UNSAFE classname test
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Jan 30, 2025
1 parent 0a1ec14 commit 5c244f0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
12 changes: 12 additions & 0 deletions packages/web-react/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SpiritComponentClass, SpiritFunctionComponent, SpiritNamedExoticComponent } from './types/shared/component';

declare module '*.md' {
const content: string;
export default content;
Expand All @@ -18,3 +20,13 @@ interface Window {
declare module 'prettier' {
export type BuiltInParserName = unknown;
}

declare global {
namespace React {
interface NamedExoticComponent<P = {}> extends SpiritNamedExoticComponent<P> {}

interface FunctionComponent<P = {}> extends SpiritFunctionComponent<P> {}

interface ComponentClass<P = {}, S = {}> extends SpiritComponentClass<P, S> {}
}
}
19 changes: 0 additions & 19 deletions packages/web-react/src/types/shared/SpiritComponentType.d.ts

This file was deleted.

12 changes: 12 additions & 0 deletions packages/web-react/src/types/shared/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ExoticComponent, FC, StaticLifecycle } from 'react';

/* eslint-disable @typescript-eslint/ban-types */
export interface SpiritNamedComponent {
spiritComponent?: string;
}

export interface SpiritNamedExoticComponent<P = {}> extends ExoticComponent<P>, SpiritNamedComponent {}

export type SpiritFunctionComponent<P = {}> = FC<P> & SpiritNamedComponent;

export interface SpiritComponentClass<P = {}, S = {}> extends StaticLifecycle<P, S>, SpiritNamedComponent {}

0 comments on commit 5c244f0

Please sign in to comment.