我有一个预期的TypeScript错误TS1128:声明或语句。我花了好几个小时却找不到错误..。它在master/node_modules/@theme-ui/core/dist/index.d.ts (4,1)中:
import * as React from 'react';
import './react-jsx';
export type { CSSObject, CSSOthersObject, CSSProperties, CSSPseudoSelectorProps, ColorMode, ColorModesScale, Label, ResponsiveStyleValue, Scale, StylePropertyValue, TLengthStyledSystem, Theme, ThemeDerivedStyles, ThemeStyles, ThemeUICSSObject, ThemeUICSSProperties, ThemeUIExtendedCSSProperties, ThemeUIStyleObject, VariantProperty, } from '@theme-ui/css';
export * from './types';
export declare const jsx: typeof React.createElement;
export interface ContextValue {
__EMOTION_VERSION__: string;
theme: Theme;
}
export declare const Context: React.Context<ContextValue>;
export declare const useThemeUI: () => ContextValue;
/**
* Deeply merge themes
*/
export declare const merge: {
(a: Theme, b: Theme): Theme;
all: typeof mergeAll;
}
declare function mergeAll<A, B>(a: A, B: B): A & B;
declare function mergeAll<A, B, C>(a: A, B: B, c: C): A & B & C;
declare function mergeAll<A, B, C, D>(a: A, B: B, c: C, d: D): A & B & C & D;
interface BaseProviderProps {
context: ContextValue;
}
export interface ThemeProviderProps {
theme: Theme | ((outerTheme: Theme) => Theme);
children?: React.ReactNode;
}
export declare function ThemeProvider({ theme, children }: ThemeProviderProps): React.FunctionComponentElement<BaseProviderProps>;发布于 2022-02-19 13:00:23
试着在下面这样做:
npm uninstall -g typescript
npm install typescript --save-devhttps://stackoverflow.com/questions/65213403
复制相似问题