Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you export a Flow type definition that is imported from another file?

Tags:

Given a type definition that is imported from another module, how do you re-export it?

/**
 * @flow
 */

import type * as ExampleType from './ExampleType';

...

// What is the syntax for exporting the type?
// export { ExampleType };
like image 686
ide Avatar asked Sep 16 '15 08:09

ide


People also ask

How do you import and export flow?

3 – Import Flow • Log in to Power Automate and select My flows • Select Import button • Select Upload button • Locate the flow zip file and select Open button • For each item in the Related resources section do the following (items are tagged with a red exclamation icon): o Select the Select during import link o Select ...

How do you export Power Automate from one environment to another?

Open Power Automate and open your flow to export. Browse to here and provide your Office 365 account details to login into your account. Select “My flows” from the left side navigation on the page. Click on “Export” drop down to start the export process and then click on “Package (.


1 Answers

The simplest form of this question is "how do I export a type alias?" and the simple answer is "with export type!"

For your example, you can write

/**
 * @flow
 */

import type * as ExampleType from './ExampleType';
export type { ExampleType };

You may ask "why is ExampleType a type alias?" Well, when you write

type MyTypeAlias = number;

You are explicitly creating the type alias MyTypeAlias which aliases number. And when you write

import type { YourTypeAlias } from './YourModule';

You are implicitly creating the type alias YourTypeAlias which aliases the YourTypeAlias export of YourModule.js.

like image 154
Gabe Levi Avatar answered Oct 02 '22 16:10

Gabe Levi