This commit is contained in:
Yuan 2023-12-15 17:11:03 +08:00
parent b5ca647503
commit e9be1725f0
4 changed files with 19 additions and 13 deletions

18
global.d.ts vendored
View File

@ -1,14 +1,14 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
declare namespace GlobalMixins { declare namespace GlobalMixins {
type JlCanvasType = import('./src/app').IJlCanvas; type JlCanvasType = import('@jl-graphic').IJlCanvas;
type CanvasProperties = import('./src/app').ICanvasProperties; type CanvasProperties = import('@jl-graphic').ICanvasProperties;
type GraphicApp = import('./src/app').IGraphicApp; type GraphicApp = import('@jl-graphic').IGraphicApp;
type JlGraphicType = import('./src/core').JlGraphic; type JlGraphicType = import('@jl-graphic').JlGraphic;
type GraphicData = import('./src/core').GraphicData; type GraphicData = import('@jl-graphic').GraphicData;
type GraphicState = import('./src/core').GraphicState; type GraphicState = import('@jl-graphic').GraphicState;
type GraphicTransform = import('./src/core').GraphicTransform; type GraphicTransform = import('@jl-graphic').GraphicTransform;
type GraphicTransformEvent = import('./src/plugins').GraphicTransformEvent; type GraphicTransformEvent = import('@jl-graphic').GraphicTransformEvent;
type BoundsGraphic = import('./src/plugins').BoundsGraphic; type BoundsGraphic = import('@jl-graphic').BoundsGraphic;
type IPointDataType = import('pixi.js').IPointData; type IPointDataType = import('pixi.js').IPointData;
type PointType = import('pixi.js').Point; type PointType = import('pixi.js').Point;
type FederatedMouseEvent = import('pixi.js').FederatedMouseEvent; type FederatedMouseEvent = import('pixi.js').FederatedMouseEvent;

2
lib/index.d.ts vendored
View File

@ -1,4 +1,4 @@
/// <reference types="../global.ts" /> /// <reference types="global" />
export * as GraphicsExtras from '@pixi/graphics-extras'; export * as GraphicsExtras from '@pixi/graphics-extras';
export * from './app'; export * from './app';
export * from './core'; export * from './core';

View File

@ -1,4 +1,5 @@
import typescript from '@rollup/plugin-typescript'; import typescript from '@rollup/plugin-typescript';
import ts from 'typescript';
/** /**
* @type {import('rollup').RollupOptions} * @type {import('rollup').RollupOptions}
@ -20,7 +21,7 @@ const config = {
logLevel: 'debug', logLevel: 'debug',
plugins: [ plugins: [
typescript({ typescript({
declaration: true, // declaration: true,
declarationDir: 'lib', declarationDir: 'lib',
include: ['src/**/*'], include: ['src/**/*'],
tsconfig: './tsconfig.json', tsconfig: './tsconfig.json',

View File

@ -5,13 +5,18 @@
"allowJs": false, "allowJs": false,
"module": "ESNext", "module": "ESNext",
"target": "ESNext", "target": "ESNext",
"moduleResolution": "Bundler", "moduleResolution": "node",
"typeRoots": ["node_modules/@types"], "typeRoots": ["node_modules/@types"],
"strict": true, "strict": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"isolatedModules": true, "isolatedModules": true,
"lib": ["esnext", "dom"], "lib": ["esnext", "dom"],
"useDefineForClassFields": true "useDefineForClassFields": true,
"declaration": true,
"allowUmdGlobalAccess": true,
"paths": {
"@jl-graphic": ["src"]
}
}, },
"include": ["src/**/*.ts", "global.d.ts"], "include": ["src/**/*.ts", "global.d.ts"],
"exclude": ["node_modules", "lib"] "exclude": ["node_modules", "lib"]