docs(changeset): Fixed types
This commit is contained in:
parent
c42bc20069
commit
027f08fe9f
5
.changeset/fuzzy-waves-talk.md
Normal file
5
.changeset/fuzzy-waves-talk.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@warkypublic/oranguru': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed types
|
||||||
47
global.d.ts
vendored
Normal file
47
global.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
declare module "*.module.css"
|
||||||
|
declare module '*.png' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.jpg' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.jpeg' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.gif' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.svg' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.ico' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.webp' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.bmp' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.tiff' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
declare module '*.cur' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add URL query suffix declarations
|
||||||
|
declare module '*?url' {
|
||||||
|
const value: string
|
||||||
|
export default value
|
||||||
|
}
|
||||||
@ -37,14 +37,16 @@
|
|||||||
"types": "./dist/lib.d.ts",
|
"types": "./dist/lib.d.ts",
|
||||||
"default": "./dist/lib.cjs.js"
|
"default": "./dist/lib.cjs.js"
|
||||||
},
|
},
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json",
|
||||||
|
"./oranguru.css": "./oranguru.css"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./src/lib.ts",
|
"types": "./src/lib.ts",
|
||||||
"default": "./src/lib.ts"
|
"default": "./src/lib.ts"
|
||||||
}
|
},
|
||||||
|
"./oranguru.css": "./oranguru.css"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@glideapps/glide-data-grid": "^6.0.3",
|
"@glideapps/glide-data-grid": "^6.0.3",
|
||||||
|
|||||||
2
src/MantineBetterMenu/MantineBetterMenu.d.ts
vendored
2
src/MantineBetterMenu/MantineBetterMenu.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
import { type MenuStoreProps } from './Store';
|
|
||||||
export declare function MantineBetterMenusProvider(props: React.PropsWithChildren<MenuStoreProps>): import("react/jsx-runtime").JSX.Element;
|
|
||||||
1
src/MantineBetterMenu/MenuRenderer.d.ts
vendored
1
src/MantineBetterMenu/MenuRenderer.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare function MenuRenderer(): import("react/jsx-runtime").JSX.Element;
|
|
||||||
43
src/MantineBetterMenu/Store.d.ts
vendored
43
src/MantineBetterMenu/Store.d.ts
vendored
@ -1,43 +0,0 @@
|
|||||||
import { type MenuItemProps, type MenuProps } from '@mantine/core';
|
|
||||||
import { type ReactNode } from 'react';
|
|
||||||
export interface MantineBetterMenuInstance {
|
|
||||||
id: string;
|
|
||||||
items?: Array<MantineBetterMenuInstanceItem>;
|
|
||||||
menuProps?: MenuProps;
|
|
||||||
renderer?: ReactNode;
|
|
||||||
visible: boolean;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
}
|
|
||||||
export interface MantineBetterMenuInstanceItem extends Partial<MenuItemProps> {
|
|
||||||
isDivider?: boolean;
|
|
||||||
label?: string;
|
|
||||||
onClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
||||||
onClickAsync?: () => Promise<void>;
|
|
||||||
renderer?: ((props: MantineBetterMenuInstanceItem & Record<string, unknown>) => ReactNode) | ReactNode;
|
|
||||||
}
|
|
||||||
export interface MenuStoreProps {
|
|
||||||
providerID?: string;
|
|
||||||
}
|
|
||||||
export type MenuStoreState = MenuStoreProps & MenuStoreStateOnly;
|
|
||||||
export interface MenuStoreStateOnly {
|
|
||||||
hide: (id: string) => void;
|
|
||||||
menus: Array<MantineBetterMenuInstance>;
|
|
||||||
setInstanceState: <K extends keyof MantineBetterMenuInstance>(instanceID: string, key: K, value: MantineBetterMenuInstance[K]) => void;
|
|
||||||
setState: <K extends keyof MenuStoreState>(key: K, value: Partial<MenuStoreState[K]>) => void;
|
|
||||||
show: (id: string, options?: Partial<MantineBetterMenuInstance>) => void;
|
|
||||||
}
|
|
||||||
declare const MantineBetterMenusStoreProvider: (props: {
|
|
||||||
children: ReactNode;
|
|
||||||
} & {
|
|
||||||
firstSyncProps?: string[];
|
|
||||||
persist?: import("zustand/middleware").PersistOptions<Partial<MenuStoreProps & MenuStoreStateOnly>, Partial<MenuStoreProps & MenuStoreStateOnly>, unknown> | undefined;
|
|
||||||
} & MenuStoreProps) => React.ReactNode, useMantineBetterMenus: {
|
|
||||||
(): {
|
|
||||||
$sync?: ((props: MenuStoreProps) => void) | undefined;
|
|
||||||
} & MenuStoreProps & MenuStoreStateOnly;
|
|
||||||
<U>(selector: (state: {
|
|
||||||
$sync?: ((props: MenuStoreProps) => void) | undefined;
|
|
||||||
} & MenuStoreProps & MenuStoreStateOnly) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
|
|
||||||
};
|
|
||||||
export { MantineBetterMenusStoreProvider, useMantineBetterMenus };
|
|
||||||
3
src/MantineBetterMenu/index.d.ts
vendored
3
src/MantineBetterMenu/index.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
export { MantineBetterMenusProvider } from './MantineBetterMenu';
|
|
||||||
export { useMantineBetterMenus } from './Store';
|
|
||||||
export type { MantineBetterMenuInstance, MantineBetterMenuInstanceItem, MenuStoreState } from './Store';
|
|
||||||
1
src/lib.d.ts
vendored
1
src/lib.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export { type MantineBetterMenuInstance, type MantineBetterMenuInstanceItem, MantineBetterMenusProvider, type MenuStoreState, useMantineBetterMenus, } from "./MantineBetterMenu";
|
|
||||||
@ -1,18 +1,23 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
"target": "ES2022",
|
"target": "es6",
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
|
"types": [
|
||||||
|
"./global.d.ts"
|
||||||
|
],
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2022",
|
"ES2016",
|
||||||
|
"ESNext",
|
||||||
"DOM",
|
"DOM",
|
||||||
"DOM.Iterable"
|
"DOM.Iterable"
|
||||||
],
|
],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "Node",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
@ -22,12 +27,15 @@
|
|||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"erasableSyntaxOnly": true,
|
"erasableSyntaxOnly": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"lib.ts",
|
||||||
|
"*.d.ts",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1,5 +1,14 @@
|
|||||||
{
|
{
|
||||||
"files": [],
|
"files": [],
|
||||||
|
"exclude": [
|
||||||
|
"public",
|
||||||
|
"dist",
|
||||||
|
"./dist",
|
||||||
|
"*.config.ts",
|
||||||
|
"node_modules",
|
||||||
|
"./.storybook",
|
||||||
|
"vite.config.ts"
|
||||||
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.app.json"
|
"path": "./tsconfig.app.json"
|
||||||
|
|||||||
@ -2,17 +2,17 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
"target": "ES2023",
|
"target": "ES2023",
|
||||||
"lib": ["ES2023"],
|
"lib": [
|
||||||
|
"ES2023"
|
||||||
|
],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
@ -21,5 +21,7 @@
|
|||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
"include": ["vite.config.ts"]
|
"include": [
|
||||||
}
|
"vite.config.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,36 +1,45 @@
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from 'vite';
|
||||||
import { dirname } from "node:path";
|
import { dirname } from 'node:path';
|
||||||
import * as path from "path";
|
import * as path from 'path';
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from 'node:url';
|
||||||
import react from "@vitejs/plugin-react-swc";
|
import react from '@vitejs/plugin-react-swc';
|
||||||
import { peerDependencies } from "./package.json";
|
import { peerDependencies } from './package.json';
|
||||||
import dts from "vite-plugin-dts";
|
import dts from 'vite-plugin-dts';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
|
react(),
|
||||||
dts({
|
dts({
|
||||||
outDir: "dist",
|
outDir: 'dist',
|
||||||
entryRoot: "src",
|
entryRoot: 'src',
|
||||||
staticImport: true,
|
staticImport: true,
|
||||||
|
copyDtsFiles: true,
|
||||||
|
rollupTypes: true,
|
||||||
|
tsconfigPath: './tsconfig.app.json',
|
||||||
|
compilerOptions: {
|
||||||
|
noEmit: false,
|
||||||
|
emitDeclarationOnly: true,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
react(),
|
|
||||||
],
|
],
|
||||||
|
publicDir: 'public',
|
||||||
build: {
|
build: {
|
||||||
|
minify: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
assetsDir: 'assets',
|
||||||
lib: {
|
lib: {
|
||||||
entry: path.resolve(__dirname, "src/lib.ts"),
|
entry: path.resolve(__dirname, 'src/lib.ts'),
|
||||||
name: "lib",
|
name: 'lib',
|
||||||
formats: ["es", "cjs"],
|
formats: ['es', 'cjs'],
|
||||||
fileName: (format) => `lib.${format}.js`,
|
fileName: (format) => `lib.${format}.js`,
|
||||||
},
|
},
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
outDir: "dist",
|
outDir: 'dist',
|
||||||
|
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: Object.keys(peerDependencies),
|
external: Object.keys(peerDependencies),
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user