For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/react/Interface.DataProcessors.md.
  • English
  • @lynx-js/react / DataProcessors

    Interface: DataProcessors

    The data processors that registered with Lynx.registerDataProcessors.

    Example

    Extending dataProcessors interface

    import type { DataProcessors as WellKnownDataProcessors } from '@lynx-js/react';
    
    declare module '@lynx-js/react' {
      interface DataProcessors extends WellKnownDataProcessors {
        foo(bar: string): number;
      }
    }

    Then you can use lynx.registerDataProcessors with types.

    lynx.registerDataProcessors({
      dataProcessors: {
        foo(bar) {
          return 1;
        }
      }
    })

    Indexable

    [processorName: string]: (...args: any[]) => any

    Methods

    getScreenMetricsOverride()?

    optional getScreenMetricsOverride(metrics: object): object

    Optional processor to override screen metrics used by the app

    Parameters

    ParameterTypeDescription
    metricsobjectThe physical screen dimensions in pixels
    metrics.heightnumberThe physical pixel height of the screen
    metrics.widthnumberThe physical pixel width of the screen

    Returns

    object

    New screen dimensions to be used by the app

    height
    height: number;
    width
    width: number;

    Example

    lynx.registerDataProcessors({
      dataProcessors: {
        getScreenMetricsOverride: (metrics) => {
          // Force a specific aspect ratio
          return {
            width: metrics.width,
            height: metrics.width * (16/9)
          };
        }
      }
    });

    Defined in

    @lynx-js/react/runtime/lib/lynx-api.d.ts:282

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.