How to use the @ephox/boulder.ValueSchema.getOrDie function in @ephox/boulder

To help you get started, we’ve selected a few @ephox/boulder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / context / ContextToolbarScopes.ts View on Github external
const registerForm = (key: string, toolbarApi: Toolbar.ContextFormApi) => {
    const contextForm = ValueSchema.getOrDie(Toolbar.createContextForm(toolbarApi));
    forms[key] = contextForm;
    contextForm.launch.map((launch) => {
      // Use the original here (pre-boulder), because using as a the spec for toolbar buttons
      formNavigators['form:' + key + ''] = {
        ...toolbarApi.launch,
        type: (launch.type === 'contextformtogglebutton' ? 'togglebutton' : 'button') as any,
        onAction: () => {
          navigate(contextForm);
        }
      };
    });

    if (contextForm.scope === 'editor') {
      inEditorScope.push(contextForm);
    } else {
      inNodeScope.push(contextForm);
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / WindowManager.ts View on Github external
const validateData = (data: T, validator: Processor) => {
  return ValueSchema.getOrDie(ValueSchema.asRaw('data', validator, data));
};