@studiocubics/types 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +17 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
- package/src/PolymorphicProps.ts +17 -0
- package/src/SetState.ts +3 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +32 -0
- package/tsup.config.ts +10 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
> @studiocubics/types@0.0.1 build /home/runner/work/StudioCubics/StudioCubics/packages/types
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/StudioCubics/StudioCubics/packages/types/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mCJS[39m Build start
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m46.00 B[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m211.00 B[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 145ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2583ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m628.00 B[39m
|
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType, ComponentPropsWithRef, ReactElement, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
|
|
3
|
+
type AsProp<C extends ElementType> = {
|
|
4
|
+
as?: C;
|
|
5
|
+
};
|
|
6
|
+
type PolymorphicComponentProps<C extends ElementType, Props = object> = AsProp<C> & Omit<ComponentPropsWithRef<C>, keyof Props | "as"> & Props;
|
|
7
|
+
type PolymorphicComponentType<Props, DefaultElement extends ElementType = "div"> = <C extends ElementType = DefaultElement>(props: PolymorphicComponentProps<C, Props>) => ReactElement | null;
|
|
8
|
+
|
|
9
|
+
type SetState<T> = Dispatch<SetStateAction<T>>;
|
|
10
|
+
|
|
11
|
+
export type { AsProp, PolymorphicComponentProps, PolymorphicComponentType, SetState };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/StudioCubics/StudioCubics/packages/types/dist/index.js"],"names":[],"mappings":"AAAA","file":"/home/runner/work/StudioCubics/StudioCubics/packages/types/dist/index.js"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@studiocubics/types",
|
|
3
|
+
"description": "Package containing helpful types by Studio Cubics",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"private": false,
|
|
8
|
+
"version": "0.0.1",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"@studiocubics",
|
|
11
|
+
"cubics",
|
|
12
|
+
"studio",
|
|
13
|
+
"types",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Studio Cubics",
|
|
18
|
+
"email": "studiocubics7@gmail.com",
|
|
19
|
+
"url": "https://studio-cubics.vercel.app"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/react": "^19.2.6",
|
|
28
|
+
"tsup": "^8.5.1"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "19"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"clean": "rimraf dist node_modules"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType, ReactElement } from "react";
|
|
2
|
+
|
|
3
|
+
export type AsProp<C extends ElementType> = {
|
|
4
|
+
as?: C;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type PolymorphicComponentProps<
|
|
8
|
+
C extends ElementType,
|
|
9
|
+
Props = object,
|
|
10
|
+
> = AsProp<C> & Omit<ComponentPropsWithRef<C>, keyof Props | "as"> & Props;
|
|
11
|
+
|
|
12
|
+
export type PolymorphicComponentType<
|
|
13
|
+
Props,
|
|
14
|
+
DefaultElement extends ElementType = "div",
|
|
15
|
+
> = <C extends ElementType = DefaultElement>(
|
|
16
|
+
props: PolymorphicComponentProps<C, Props>
|
|
17
|
+
) => ReactElement | null;
|
package/src/SetState.ts
ADDED
package/src/index.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
|
|
12
|
+
/* Bundler mode */
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"allowImportingTsExtensions": true,
|
|
15
|
+
"verbatimModuleSyntax": true,
|
|
16
|
+
"moduleDetection": "force",
|
|
17
|
+
"noEmit": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
// Output
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"outDir": "./dist",
|
|
22
|
+
|
|
23
|
+
/* Linting */
|
|
24
|
+
"strict": true,
|
|
25
|
+
"noUnusedLocals": true,
|
|
26
|
+
"noUnusedParameters": true,
|
|
27
|
+
"erasableSyntaxOnly": true,
|
|
28
|
+
"noFallthroughCasesInSwitch": true,
|
|
29
|
+
"noUncheckedSideEffectImports": true
|
|
30
|
+
},
|
|
31
|
+
"include": ["src"]
|
|
32
|
+
}
|