How to use the react-native-tscodegen-types.TurboModuleRegistry.getEnforcing function in react-native-tscodegen-types

To help you get started, we’ve selected a few react-native-tscodegen-types 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 microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / modules_success / EMPTY_NATIVE_MODULE.ts View on Github external
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Automatically generated from modules_success/EMPTY_NATIVE_MODULE.flow.js
// (/react-native/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js)

import {TurboModule} from 'react-native-tscodegen-types'
import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export interface Spec extends TurboModule {
}

export default TurboModuleRegistry.getEnforcing('SampleTurboModule');
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / modules_failure / NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM.ts View on Github external
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Automatically generated from modules_failure/NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM.flow.js
// (/react-native/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/failures.js)

import {TurboModule} from 'react-native-tscodegen-types'
import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export interface Spec extends TurboModule {
  getString(arg: Array): string;
}

export default TurboModuleRegistry.getEnforcing('SampleTurboModule');
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / modules_success / NATIVE_MODULE_WITH_NULLABLE_PARAM.ts View on Github external
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Automatically generated from modules_success/NATIVE_MODULE_WITH_NULLABLE_PARAM.flow.js
// (/react-native/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js)

import {ReactNull} from 'react-native-tscodegen-types';
import {TurboModule} from 'react-native-tscodegen-types'
import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export interface Spec extends TurboModule {
  voidFunc(arg: (ReactNull | string)): void;
}

export default TurboModuleRegistry.getEnforcing('SampleTurboModule');
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / e2e_modules / NativeNumberTurboModule.ts View on Github external
// (/react-native/packages/react-native-codegen/e2e/__test_fixtures__)

import {TurboModule} from 'react-native-tscodegen-types'
import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export type Number = number;

type AnotherNumber = Number;

export interface Spec extends TurboModule {
  getNumber(arg: number): number;
  getNumberWithAlias(arg: Number): AnotherNumber;
}

export default (TurboModuleRegistry.getEnforcing('SampleTurboModule') as Spec);
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / modules_failure / TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT.ts View on Github external
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Automatically generated from modules_failure/TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT.flow.js
// (/react-native/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/failures.js)

import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export default TurboModuleRegistry.getEnforcing('SampleTurboModule1');

export default TurboModuleRegistry.getEnforcing('SampleTurboModule2');
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / e2e_modules / NativeNullableTurboModule.ts View on Github external
import {ReactNull} from 'react-native-tscodegen-types';
import {TurboModule} from 'react-native-tscodegen-types'
import {TurboModuleRegistry} from 'react-native-tscodegen-types';
'use strict';

export interface Spec extends TurboModule {
  getBool(a: (ReactNull | boolean)): (ReactNull | boolean);
  getNumber(a: (ReactNull | number)): (ReactNull | number);
  getString(a: (ReactNull | number)): (ReactNull | string);
  getArray(a: (ReactNull | Array)): (ReactNull | Array);
  getObject(a: (ReactNull | Object)): (ReactNull | Object);
  getValueWithPromise(): (ReactNull | Promise);
}

export default (TurboModuleRegistry.getEnforcing('SampleTurboModule') as Spec);
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / modules_success / NATIVE_MODULE_WITH_COMPLEX_OBJECTS_WITH_NULLABLE_KEY.ts View on Github external
getConstants(): {
    isTesting: boolean;
    reactNativeVersion: {
      major: number;
      minor: number;
      patch?: number;
      prerelease: (ReactNull | number);
    };
    forceTouchAvailable: boolean;
    osVersion: string;
    systemName: string;
    interfaceIdiom: string;
  };
}

export default TurboModuleRegistry.getEnforcing('PlatformConstants');

react-native-tscodegen-types

TypeScript Code Generation for React Native Turbo Module

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages