-
Notifications
You must be signed in to change notification settings - Fork 1
feat: added typescript types for exported functions #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| export type ScrambleType = | ||
| | "333" | ||
| | "444" | ||
| | "555" | ||
| | "666" | ||
| | "777" | ||
| | "222" | ||
| | "sq1" | ||
| | "pyraminx" | ||
| | "skewb" | ||
| | "mgmp" | ||
| | "kilominx" | ||
| | "redi" | ||
| | "fto" | ||
| | "clock" | ||
| | "1x3x3" | ||
| | "2x2x3" | ||
| | "333lse" | ||
| | "gearcube" | ||
| | "mgmlsll" | ||
| | "slide" | ||
| | string; | ||
|
|
||
| export interface ScrambleOptions { | ||
| type?: ScrambleType; | ||
| length?: number; | ||
| state?: unknown; | ||
| neutrality?: number; | ||
| } | ||
|
|
||
| export function getScrambleTypes(): ScrambleType[]; | ||
|
|
||
| export function setSeed(seed: string | number | undefined | null): void; | ||
|
|
||
| export function getScramble( | ||
| type?: ScrambleType, | ||
| length?: number, | ||
| state?: unknown, | ||
| neutrality?: number, | ||
| ): string; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| // Visit https://aka.ms/tsconfig to read more about this file | ||
| "compilerOptions": { | ||
| // File Layout | ||
| // "rootDir": "./src", | ||
| // "outDir": "./dist", | ||
|
|
||
| // Environment Settings | ||
| // See also https://aka.ms/tsconfig/module | ||
| "module": "nodenext", | ||
| "target": "esnext", | ||
| "types": [], | ||
| // For nodejs: | ||
| // "lib": ["esnext"], | ||
| // "types": ["node"], | ||
| // and npm install -D @types/node | ||
|
|
||
| // Other Outputs | ||
| "sourceMap": true, | ||
| "declaration": true, | ||
| "declarationMap": true, | ||
|
|
||
| // Stricter Typechecking Options | ||
| "noUncheckedIndexedAccess": true, | ||
| "exactOptionalPropertyTypes": true, | ||
|
|
||
| // Style Options | ||
| // "noImplicitReturns": true, | ||
| // "noImplicitOverride": true, | ||
| // "noUnusedLocals": true, | ||
| // "noUnusedParameters": true, | ||
| // "noFallthroughCasesInSwitch": true, | ||
| // "noPropertyAccessFromIndexSignature": true, | ||
|
|
||
| // Recommended Options | ||
| "strict": true, | ||
| "jsx": "react-jsx", | ||
| "verbatimModuleSyntax": true, | ||
| "isolatedModules": true, | ||
| "noUncheckedSideEffectImports": true, | ||
| "moduleDetection": "force", | ||
| "skipLibCheck": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>); | ||
| export default _default; | ||
| //# sourceMappingURL=tsup.config.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| import { defineConfig } from "tsup"; | ||
|
|
||
| export default defineConfig({ | ||
| entry: ["src/index.js"], | ||
| format: ["esm", "cjs"], | ||
| splitting: false, | ||
| sourcemap: true, | ||
| clean: true, | ||
| outDir: "dist", | ||
| target: "es2020", | ||
| dts: false, | ||
| minify: false | ||
| entry: ["src/index.js"], | ||
| format: ["esm", "cjs"], | ||
| splitting: false, | ||
| sourcemap: true, | ||
| clean: true, | ||
| outDir: "dist", | ||
| target: "es2020", | ||
| dts: false, | ||
| minify: false, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.jsondeclarestypes: "./index.d.ts", but thefilesallowlist only includesdist, soindex.d.tswill not be published to npm and consumers will still see missing types. Addindex.d.ts(and any referenced.d.ts.mapif you intend to ship it) to thefilesarray, or remove thefilesallowlist so the types file is included in the published package.