Skip to content

Commit 64309ce

Browse files
committed
feat: add optional styles param to o.text
1 parent 226729c commit 64309ce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • s/timeline/sugar

‎s/timeline/sugar/o.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,17 @@ export class O {
114114
return item
115115
}
116116

117-
text = (content: string): Item.Text => {
117+
text = (content: string, styles?: TextStyleOptions): Item.Text => {
118118
const item = {
119119
id: this.#getId(),
120120
content,
121121
kind: Kind.Text,
122122
duration: 2000
123123
} as Item.Text
124+
125+
if(styles)
126+
item.styleId = this.textStyle(styles).id
127+
124128
this.register(item)
125129
return item
126130
}

0 commit comments

Comments
 (0)