去掉了对react-scripts的依赖

This commit is contained in:
Xu Chang 2023-09-15 09:48:57 +08:00
parent 03304477d5
commit c7376a6af8
7 changed files with 80 additions and 7 deletions

1
es/index.d.ts vendored
View File

@ -1,3 +1,4 @@
/// <reference path="../typings/react.d.ts" />
export type { BasicFeatures } from './features'; export type { BasicFeatures } from './features';
export { Cache } from './features/cache'; export { Cache } from './features/cache';
export { LocalStorage } from './features/localStorage'; export { LocalStorage } from './features/localStorage';

View File

@ -1,3 +1,4 @@
/// <reference path="../typings/react.d.ts" />
export { Cache } from './features/cache'; export { Cache } from './features/cache';
export { LocalStorage } from './features/localStorage'; export { LocalStorage } from './features/localStorage';
export * from './types/Feature'; export * from './types/Feature';

1
lib/index.d.ts vendored
View File

@ -1,3 +1,4 @@
/// <reference path="../typings/react.d.ts" />
export type { BasicFeatures } from './features'; export type { BasicFeatures } from './features';
export { Cache } from './features/cache'; export { Cache } from './features/cache';
export { LocalStorage } from './features/localStorage'; export { LocalStorage } from './features/localStorage';

View File

@ -1,4 +1,5 @@
"use strict"; "use strict";
/// <reference path="../typings/react.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.DebugStore = exports.SyncTriggerExecutor = exports.CacheStore = exports.LocalStorage = exports.Cache = void 0; exports.DebugStore = exports.SyncTriggerExecutor = exports.CacheStore = exports.LocalStorage = exports.Cache = void 0;
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");

View File

@ -23,7 +23,6 @@
"oak-memory-tree-store": "file:../oak-memory-tree-store", "oak-memory-tree-store": "file:../oak-memory-tree-store",
"ol": "^7.3.0", "ol": "^7.3.0",
"react-responsive": "^9.0.2", "react-responsive": "^9.0.2",
"react-scripts": "^5.0.1",
"rmc-pull-to-refresh": "^1.0.13", "rmc-pull-to-refresh": "^1.0.13",
"socket.io-client": "^4.7.2", "socket.io-client": "^4.7.2",
"url": "^0.11.0", "url": "^0.11.0",

View File

@ -1,4 +1,3 @@
export type { BasicFeatures } from './features'; export type { BasicFeatures } from './features';
export { Cache } from './features/cache'; export { Cache } from './features/cache';
export { LocalStorage } from './features/localStorage'; export { LocalStorage } from './features/localStorage';

81
typings/react.d.ts vendored
View File

@ -1,8 +1,79 @@
/// <reference types="react-scripts" /> /// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
readonly PUBLIC_URL: string;
}
}
declare module '*.avif' {
const src: string;
export default src;
}
declare module '*.bmp' {
const src: string;
export default src;
}
declare module '*.gif' {
const src: string;
export default src;
}
declare module '*.jpg' {
const src: string;
export default src;
}
declare module '*.jpeg' {
const src: string;
export default src;
}
declare module '*.png' {
const src: string;
export default src;
}
declare module '*.webp' {
const src: string;
export default src;
}
declare module '*.svg' {
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
> & { title?: string }>;
const src: string;
export default src;
}
declare module '*.module.css' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.scss' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.sass' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.less' { declare module '*.module.less' {
const classes: { const classes: {
readonly [key: string]: string; readonly [key: string]: string;
}; };
export default classes; export default classes;
} }