Skip to content

Commit 608a029

Browse files
committed
Add type for addLayer
1 parent ab6c89b commit 608a029

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/components/pg/inputPixelEditor/inputPixelEditor.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ interface Export {
9696
height?: number
9797
}
9898

99+
interface AddLayerOptions {
100+
name: string
101+
type: Layer['type']
102+
exclude?: boolean
103+
locked?: boolean
104+
hidden?: boolean
105+
opacity?: number
106+
data?: any[]
107+
}
108+
99109
interface GridItem {
100110
value: number
101111
color: number
@@ -1385,7 +1395,7 @@ export default class PgInputPixelEditor extends HTMLElement {
13851395
this.#layer = indexes;
13861396
}
13871397

1388-
addLayer({ name, type, ...optional }) {
1398+
addLayer({ name, type, ...optional }: AddLayerOptions) {
13891399
this.#data.push(fillGrid(this.width, this.height));
13901400
this.#layers.push({
13911401
name,

0 commit comments

Comments
 (0)