@solidrt/core 0.0.3 → 0.0.5

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/jsx-runtime.d.ts CHANGED
@@ -16,6 +16,13 @@ export namespace JSX {
16
16
  type Element = SolidJSX.Element
17
17
  type ElementChildrenAttribute = SolidJSX.ElementChildrenAttribute
18
18
 
19
+ type RefCallback<T> = (el: T) => void
20
+ type Ref<T> = T | RefCallback<T>
21
+
22
+ interface IntrinsicAttributes {
23
+ ref?: Ref<{ id: number }> | undefined
24
+ }
25
+
19
26
  interface IntrinsicElements {
20
27
  window: WindowProps
21
28
  view: ViewProps
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@solidrt/core",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "author": "Antoine van Wel",
6
6
  "type": "module",
7
7
  "main": "src/index.ts",
8
8
  "exports": {
9
9
  ".": "./src/index.ts",
10
+ "./gpu": "./src/gpu.ts",
10
11
  "./jsx-runtime": "./jsx-runtime.d.ts",
11
12
  "./jsx-runtime-dev": "./jsx-runtime.d.ts"
12
13
  },
@@ -19,7 +20,7 @@
19
20
  "colord": "^2.9.3"
20
21
  },
21
22
  "devDependencies": {
22
- "@solidrt/flux-types": "0.0.3"
23
+ "@solidrt/flux-types": "0.0.5"
23
24
  },
24
25
  "peerDependencies": {
25
26
  "@solidjs/signals": "2.0.0-beta.13",
package/src/gpu.ts ADDED
@@ -0,0 +1,13 @@
1
+ export type DecodedImage = {
2
+ data: Uint8Array
3
+ width: number
4
+ height: number
5
+ }
6
+
7
+ export function decodeImage(bytes: Uint8Array): DecodedImage {
8
+ return gpu.decodeImage(bytes)
9
+ }
10
+
11
+ export function createTexture(data: Uint8Array, width: number, height: number): number {
12
+ return gpu.createTexture(data, width, height)
13
+ }
package/src/index.ts CHANGED
@@ -2,4 +2,21 @@ export * from "./renderer"
2
2
  export { setFocus, getFocusedNodeId } from "./focus"
3
3
  export { onRender, onLayout, onResize, onWindowFocus, onWindowBlur } from "./window"
4
4
  export { measureText } from "./text"
5
- export type { MeasureTextOptions } from "./types"
5
+ export { createTexture, decodeImage } from "./gpu"
6
+ export type { DecodedImage } from "./gpu"
7
+ export type {
8
+ LayoutProps,
9
+ TransformProps,
10
+ PointerProps,
11
+ PaintProps,
12
+ WindowProps,
13
+ ViewProps,
14
+ RectProps,
15
+ OvalProps,
16
+ PathProps,
17
+ TextProps,
18
+ TextureProps,
19
+ AudioProps,
20
+ MeasureTextOptions,
21
+ Color,
22
+ } from "./types"
package/src/types.d.ts CHANGED
@@ -13,6 +13,11 @@ declare global {
13
13
  setTextInputActive(active: boolean): void
14
14
  measureText(text: string, options?: MeasureTextOptions): { width: number, height: number }
15
15
  }
16
+
17
+ let gpu: {
18
+ createTexture(data: Uint8Array, width: number, height: number): number
19
+ decodeImage(bytes: Uint8Array): { data: Uint8Array, width: number, height: number }
20
+ }
16
21
  }
17
22
 
18
23
  export interface MeasureTextOptions {