Skip to content

Commit f64e079

Browse files
committed
fix: add root type
1 parent 8c42d53 commit f64e079

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.1.1] - 2022-11-15
8+
9+
### Fixes
10+
- Add root type #14 - @tommywalkie
11+
- Add Array prop type to typescript definition
12+
713
## [3.1.0] - 2022-11-15
814

915
### Updates

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ficusjs/core",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "Core functions for FicusJS",
55
"type": "module",
66
"main": "dist/index.mjs",

types/index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
export type CustomElementGetter = () => any
33
export type CustomElementMethod = (...args: any[]) => void
44

5-
export interface CustomElementProperty {
6-
type: String | Number | Boolean | Object
5+
export interface CustomElementProperty<AT> {
6+
type: String | Number | Boolean | Object | Array<AT>
77
required?: boolean
88
observed?: boolean
9-
default?: string | number | boolean | object
9+
default?: string | number | boolean | object | Array<AT>
1010
}
1111

1212
export interface CustomElementComputedTree {
1313
[key: string]: CustomElementGetter
1414
}
1515

16-
export interface CustomElementPropertyTree {
17-
[key: string]: CustomElementProperty
16+
export interface CustomElementPropertyTree<AT> {
17+
[key: string]: CustomElementProperty<AT>
1818
}
1919

20-
export type CustomElementOptions<T> = {
21-
renderer?: (what: T, where: Element) => void
20+
export type CustomElementOptions<WT, AT> = {
21+
renderer?: (what: WT, where: Element) => void
2222
root?: "standard" | "shadow" | "shadow:closed"
23-
render: () => T
23+
render: () => WT
2424
computed?: CustomElementComputedTree
25-
props?: CustomElementPropertyTree
25+
props?: CustomElementPropertyTree<AT>
2626
created?: () => void
2727
mounted?: () => void
2828
updated?: () => void
@@ -32,7 +32,7 @@ export type CustomElementOptions<T> = {
3232
[key: string]: CustomElementMethod
3333
}
3434

35-
export declare function createCustomElement<I, T>(tagName: string, options: CustomElementOptions<T>): void
35+
export declare function createCustomElement<WT, AT>(tagName: string, options: CustomElementOptions<WT, AT>): void
3636

3737
// Modules
3838
type UseFn = typeof use

0 commit comments

Comments
 (0)