@divkitframework/divkit 25.2.0 → 25.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divkitframework/divkit",
3
- "version": "25.2.0",
3
+ "version": "25.3.0",
4
4
  "description": "DivKit for the web",
5
5
  "keywords": [
6
6
  "server-driven-ui",
@@ -8,7 +8,8 @@ import type {
8
8
  CustomActionCallback,
9
9
  Theme,
10
10
  Customization,
11
- DivExtensionClass
11
+ DivExtensionClass,
12
+ TypefaceProvider
12
13
  } from './common';
13
14
  import type { GlobalVariablesController, Variable } from './variables';
14
15
  import type { WrappedError } from './common';
@@ -28,6 +29,7 @@ export function render(opts: {
28
29
  onCustomAction?: CustomActionCallback;
29
30
  onError?: ErrorCallback;
30
31
  onComponent?: ComponentCallback;
32
+ typefaceProvider?: TypefaceProvider;
31
33
  platform?: Platform;
32
34
  customization?: Customization;
33
35
  builtinProtocols?: string[];
@@ -7,7 +7,8 @@ import type {
7
7
  CustomActionCallback,
8
8
  Theme,
9
9
  Customization,
10
- DivExtensionClass
10
+ DivExtensionClass,
11
+ TypefaceProvider
11
12
  } from './common';
12
13
  import type { GlobalVariablesController } from './variables';
13
14
 
@@ -21,6 +22,7 @@ export function render(opts: {
21
22
  onStat?: StatCallback;
22
23
  onCustomAction?: CustomActionCallback;
23
24
  onError?: ErrorCallback;
25
+ typefaceProvider?: TypefaceProvider;
24
26
  platform?: Platform;
25
27
  customization?: Customization;
26
28
  builtinProtocols?: string[];
@@ -7,7 +7,8 @@ import type {
7
7
  CustomActionCallback,
8
8
  Theme,
9
9
  Customization,
10
- DivExtensionClass
10
+ DivExtensionClass,
11
+ TypefaceProvider
11
12
  } from './common';
12
13
  import type { GlobalVariablesController } from './variables';
13
14
 
@@ -20,6 +21,7 @@ export function render(opts: {
20
21
  onStat?: StatCallback;
21
22
  onCustomAction?: CustomActionCallback;
22
23
  onError?: ErrorCallback;
24
+ typefaceProvider?: TypefaceProvider;
23
25
  platform?: Platform;
24
26
  customization?: Customization;
25
27
  builtinProtocols?: string[];
@@ -150,6 +150,10 @@ export type ErrorCallback = (details: {
150
150
  error: WrappedError;
151
151
  }) => void;
152
152
 
153
+ export type TypefaceProvider = (fontFamily: string, opts?: {
154
+ fontWeight?: number;
155
+ }) => string;
156
+
153
157
  export interface DivkitInstance {
154
158
  $destroy(): void;
155
159
  execAction(action: Action | VisibilityAction): void;
@@ -2,7 +2,8 @@ import type {
2
2
  DivJson,
3
3
  ErrorCallback,
4
4
  Platform,
5
- Customization
5
+ Customization,
6
+ TypefaceProvider
6
7
  } from './common';
7
8
 
8
9
  export function render(opts: {
@@ -13,4 +14,5 @@ export function render(opts: {
13
14
  customization?: Customization;
14
15
  builtinProtocols?: string[];
15
16
  onError?: ErrorCallback;
17
+ typefaceProvider?: TypefaceProvider;
16
18
  }): string;