@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.
@@ -0,0 +1,17 @@
1
+
2
+ > @studiocubics/types@0.0.1 build /home/runner/work/StudioCubics/StudioCubics/packages/types
3
+ > tsup
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/runner/work/StudioCubics/StudioCubics/packages/types/tsup.config.ts
9
+ CLI Target: es2022
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ CJS dist/index.js 46.00 B
13
+ CJS dist/index.js.map 211.00 B
14
+ CJS ⚡️ Build success in 145ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 2583ms
17
+ DTS dist/index.d.ts 628.00 B
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @studiocubics/types
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - First publish inshallah!
@@ -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;
@@ -0,0 +1,3 @@
1
+ import type { Dispatch, SetStateAction } from "react";
2
+
3
+ export type SetState<T> = Dispatch<SetStateAction<T>>;
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./PolymorphicProps";
2
+ export * from "./SetState";
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
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ splitting: true,
6
+ sourcemap: true,
7
+ clean: true,
8
+ dts: true,
9
+ external: ["react"],
10
+ });