@dxos/echo
    Preparing search index...

    Function defineContent

    • Define one step of a content format carried by an object type.

      The type's schema must mark its version field with ContentVersionAnnotation. Steps chain by version: an object at from is upgraded through every step reachable from it.

      Type Parameters

      Parameters

      • options: DefineContentMigrationOptions<S>

      Returns ContentMigration

      const sceneParams = Migration.defineContent({
      type: Drawing.Canvas,
      from: 'dxos.org/scene/1',
      to: 'dxos.org/scene/2',
      since: '0.11.0',
      transform: ({ content }) => ({ content: upgradeRecords(content) }),
      });

      O(fields) at definition time; walks the schema's top-level properties.