@odoo/o-spreadsheet 16.5.0-alpha.2 → 16.5.0-alpha.3

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.
@@ -1083,11 +1083,6 @@ interface ImageProviderInterface {
1083
1083
  getImageOriginalSize(path: string): Promise<FigureSize>;
1084
1084
  }
1085
1085
 
1086
- interface NotifyUIEvent {
1087
- type: "ERROR";
1088
- text: string;
1089
- }
1090
-
1091
1086
  /**
1092
1087
  * Model
1093
1088
  *
@@ -1133,7 +1128,8 @@ interface ModelConfig {
1133
1128
  readonly transportService: TransportService;
1134
1129
  readonly client: Client;
1135
1130
  readonly snapshotRequested: boolean;
1136
- readonly notifyUI: (payload: NotifyUIEvent) => void;
1131
+ readonly notifyUI: (payload: InformationNotification) => void;
1132
+ readonly raiseBlockingErrorUI: (text: string) => void;
1137
1133
  }
1138
1134
  interface ModelExternalConfig {
1139
1135
  readonly fileStore?: FileStore;
@@ -1363,7 +1359,7 @@ declare class BasePlugin<State = any, C = any> implements CommandHandler<C>, Val
1363
1359
  checkValidations<T>(command: T, ...validations: Validation<T>[]): CommandResult | CommandResult[];
1364
1360
  }
1365
1361
 
1366
- type UIActions = Pick<ModelConfig, "notifyUI">;
1362
+ type UIActions = Pick<ModelConfig, "notifyUI" | "raiseBlockingErrorUI">;
1367
1363
  interface UIPluginConfig {
1368
1364
  readonly getters: Getters;
1369
1365
  readonly stateObserver: StateObserver;
@@ -2828,16 +2824,19 @@ type TranslationFunction = (string: string, ...values: string[] | [{
2828
2824
  /***
2829
2825
  * Allow to inject a translation function from outside o-spreadsheet.
2830
2826
  * @param tfn the function that will do the translation
2827
+ * @param loaded a function that returns true when the translation is loaded
2831
2828
  */
2832
- declare function setTranslationMethod(tfn: TranslationFunction): void;
2829
+ declare function setTranslationMethod(tfn: TranslationFunction, loaded?: () => boolean): void;
2833
2830
 
2834
2831
  interface EditTextOptions {
2835
2832
  error?: string;
2836
2833
  placeholder?: string;
2837
2834
  }
2835
+ type NotificationType = "danger" | "info" | "success" | "warning";
2838
2836
  interface InformationNotification {
2839
2837
  text: string;
2840
- tag: string;
2838
+ type: NotificationType;
2839
+ sticky: boolean;
2841
2840
  }
2842
2841
  interface SpreadsheetEnv {
2843
2842
  notifyUser: (notification: InformationNotification) => any;
@@ -6693,7 +6692,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6693
6692
  onCompositionEnd(): void;
6694
6693
  onKeydown(ev: KeyboardEvent): void;
6695
6694
  onInput(ev: InputEvent): void;
6696
- onKeyup(): void;
6695
+ onKeyup(ev: KeyboardEvent): void;
6697
6696
  showAutocomplete(searchTerm: string): void;
6698
6697
  /**
6699
6698
  * This is required to ensure the content helper selection is
@@ -6863,7 +6862,6 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
6863
6862
  private bindModelEvents;
6864
6863
  private unbindModelEvents;
6865
6864
  private checkViewportSize;
6866
- private onNotifyUI;
6867
6865
  openSidePanel(panel: string, panelProps: any): void;
6868
6866
  closeSidePanel(): void;
6869
6867
  toggleSidePanel(panel: string, panelProps: any): void;