@cesdk/node 1.24.0 → 1.25.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/index.d.ts CHANGED
@@ -2947,6 +2947,18 @@ export declare class EditorAPI {
2947
2947
  * @returns A method to unsubscribe.
2948
2948
  */
2949
2949
  onSettingsChanged: (callback: () => void) => (() => void);
2950
+ /**
2951
+ * Subscribe to changes to the editor role.
2952
+ *
2953
+ * This lets you react to changes in the role of the user and update engine
2954
+ * and editor settings in response.
2955
+ *
2956
+ * @param callback - This function will be called immediately after a role has
2957
+ * been set and the default settings for that role have been applied. This function
2958
+ * will also be called in case the role is set to the same value as before.
2959
+ * @returns A function for unsubscribing
2960
+ */
2961
+ onRoleChanged: (callback: (role: RoleString) => void) => (() => void);
2950
2962
  /**
2951
2963
  * Set a boolean setting.
2952
2964
  * @param keypath - The settings keypath, e.g. `doubleClickToCropEnabled`
@@ -3048,7 +3060,7 @@ export declare class EditorAPI {
3048
3060
  getSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`): RGBA;
3049
3061
  /**
3050
3062
  * Set an enum setting.
3051
- * @param keypath - The settings keypath, e.g. `role`.
3063
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3052
3064
  * @param value - The enum value as string.
3053
3065
  */
3054
3066
  setSettingEnum<T extends keyof SettingsEnum>(keypath: T, value: SettingsEnum[T]): void;
@@ -3057,7 +3069,7 @@ export declare class EditorAPI {
3057
3069
 
3058
3070
  /**
3059
3071
  * Get an enum setting.
3060
- * @param keypath - The settings keypath, e.g. `role`.
3072
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3061
3073
  * @returns The value as string.
3062
3074
  */
3063
3075
  getSettingEnum<T extends keyof SettingsEnum>(keypath: T): SettingsEnum[T];
@@ -3066,12 +3078,20 @@ export declare class EditorAPI {
3066
3078
 
3067
3079
  /**
3068
3080
  * Get the possible enum options for a given enum setting.
3069
- * @param keypath - The settings keypath, e.g. `role`.
3081
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3070
3082
  * @returns The possible enum options as strings.
3071
3083
  */
3072
3084
  getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: T): string[];
3073
3085
  /** @deprecated Support for `ubq://` prefixed keypaths will be removed in a future release. */
3074
3086
  getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: `ubq://${T}`): string[];
3087
+ /**
3088
+ * Set the role of the user and apply role-dependent defaults for scopes and settings
3089
+ */
3090
+ setRole(role: RoleString): void;
3091
+ /**
3092
+ * Get the current role of the user
3093
+ */
3094
+ getRole(): RoleString;
3075
3095
  /**
3076
3096
  * Returns a list of all the settings available.
3077
3097
  * @returns A list of settings keypaths.
@@ -3079,7 +3099,7 @@ export declare class EditorAPI {
3079
3099
  findAllSettings(): string[];
3080
3100
  /**
3081
3101
  * Returns the type of a setting.
3082
- * @param keypath - The settings keypath, e.g. `role`.
3102
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3083
3103
  * @returns The setting type.
3084
3104
  */
3085
3105
  getSettingType(keypath: string): SettingType;
@@ -3841,7 +3861,6 @@ export declare type SettingsColorRGBA = SettingsColor;
3841
3861
 
3842
3862
  /** @public */
3843
3863
  export declare type SettingsEnum = {
3844
- role: RoleString;
3845
3864
  doubleClickSelectionMode: 'Direct' | 'Hierarchical';
3846
3865
  'touch/pinchAction': 'None' | 'Zoom' | 'Scale';
3847
3866
  'touch/rotateAction': 'None' | 'Rotate';