@@ -287,6 +287,26 @@ public enum TextAutoResize: String, Codable {
287
287
case truncate = " TRUNCATE "
288
288
}
289
289
290
+ /// Type of hyperlink
291
+ public enum HyperlinkType : String , Codable {
292
+ case url = " URL "
293
+ case node = " NODE "
294
+ }
295
+
296
+ public struct Hyperlink : Codable {
297
+ public let type : HyperlinkType ?
298
+ /// URL being linked to, if URL type
299
+ public let url : String ?
300
+ /// ID of frame hyperlink points to, if NODE type
301
+ public let nodeId : String ?
302
+
303
+ public init ( type: HyperlinkType ? , url: String ? , nodeId: String ? ) {
304
+ self . type = type
305
+ self . url = url
306
+ self . nodeId = nodeId
307
+ }
308
+ }
309
+
290
310
/// Metadata for character formatting
291
311
///
292
312
/// [Figma documentation](https://www.figma.com/developers/api#typestyle-type)
@@ -307,10 +327,12 @@ public struct TypeStyle: Codable {
307
327
public let textDecoration : TextDecoration ?
308
328
/// Dimensions along which text will auto resize, default is that the text does not auto-resize
309
329
public let textAutoResize : TextAutoResize ?
330
+ /// Link to a URL or frame
331
+ public let hyperlink : Hyperlink ?
310
332
/// Line height in px
311
333
public let lineHeightPx : Double
312
334
313
- public init ( fontFamily: String , paragraphSpacing: Double ? , italic: Bool ? , fontWeight: Double , fontSize: Double , textCase: TextCase ? , textDecoration: TextDecoration ? , textAutoResize: TextAutoResize ? , lineHeightPx: Double ) {
335
+ public init ( fontFamily: String , paragraphSpacing: Double ? , italic: Bool ? , fontWeight: Double , fontSize: Double , textCase: TextCase ? , textDecoration: TextDecoration ? , textAutoResize: TextAutoResize ? , hyperlink : Hyperlink ? , lineHeightPx: Double ) {
314
336
self . fontFamily = fontFamily
315
337
self . paragraphSpacing = paragraphSpacing
316
338
self . italic = italic
@@ -319,6 +341,7 @@ public struct TypeStyle: Codable {
319
341
self . textCase = textCase
320
342
self . textDecoration = textDecoration
321
343
self . textAutoResize = textAutoResize
344
+ self . hyperlink = hyperlink
322
345
self . lineHeightPx = lineHeightPx
323
346
}
324
347
}
0 commit comments