ArchiveorgSoftwareA central repository for Flow library definitions flow-typed is a repository[1] of third-partylibrary interface definitions[2]for use with Flow[3].You can grab definitions directly from this GitHub repo, or you can use the CLI (currently in beta) to install a libdef for a given library:```bash$ yarn global add flow-typed$ cd /path/to/my/project$ yarn install$ flow-typed install rxjs@5.0.x'rxjsv5.0.x.js' installed at /path/to/my/project/flow-typed/npm/rxjsv5.0.x.js```Huh?When you start a project with Flow, you likely want to use some third-partylibraries that were not written with Flow. By default, Flow will just ignorethese libraries leaving them untyped. As a result, Flow can't give errors ifyou accidentally mis-use the library (nor will it be able to auto-complete thelibrary).To address this, Flow supportslibrary definitions[4] which allowyou to describe the interface of a module or library separate from theimplementation of that module/library.The flow-typed repo is a collection of high-quality library definitions,tests to ensure that definitions remain high quality, and tooling to make itas easy as possible to import them into your project.All you have to do when you add one or more new dependencies to your projectis run flow-typed install. This will search the libdef repo and download allthe libdefs that are relevant for your project and install them for you. Afterthat, simply check them in and be on your way!Getting StartedCheck out Importing And Using Type Definitions[5]in the wiki. It will walk you through using typedefs installed through flow-typed,as well as writing and including your own.FAQsBefore opening an issue, take a look at the FAQs[6].Chances are your question has already been answered! If not, don't hesitate toopen an issue[7].How Do I Contribute Library Definitions?Just send a pull request! The wiki onContributing Library Definitions[8]details the format of new contributions. Contributions should follow the best practices outline onCONTRIBUTING.md[9].Contributing to the CLIBugfixes and improvements to the core CLI are welcome. If you'd like to contributea new feature, consider opening an issue first to discuss it.flow-typed CLIThe flow-typed npm package provides a CLI that includes several commands forworking with this repository. The full list of commands is available atCLI Commands & Flags[10].flow-typed install [package-specification] [--ignoreDeps deps]Installs libdefs from looking at your package.json.If package-specification was specified, only that one libdef will be installed.If the --ignoreDeps flag was specified, the libdefs for the specified deps will be ignored. i.e: --ignoreDeps dev bundled peer.bashflow-typed install Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein! validate-defsVerifies that all files under the /definitions/ directory are structured andnamed properly. It does not run tests, it only asserts that file anddirectory names match the expected conventions.This command is run during CI.flow-typed run-tests [optional-pattern]For each libdef, find each test and run it with all compatible versions of Flow.If any errors arise that are not // $FlowExpectedError, the test has failed.Note that this command assumes that the /definitions/ directory is correctlystructured. It should be run after running flow-typed validate-defs.flow-typed update-cache [--debug]By default flow-typed retrieves all available libdefs from its related upstreamrepository. To make this process more efficient, those libdefs are cached onceon your local filesystem. Usually, the cache will automatically be updated aftera short grace period during a libdef installation, but sometimes it is useful todo this update manually. Use this command if you want to download the mostrecent definitions into the cache for yourself.flow-typed create-stub package-specification [--typescript]Creates any-typed libdef that you can fill in.If the --typescript flag was set to true, TypeScript definition would be converted to flow-typed libdef format if possible.Please report any issues that you have encountered to flowgen[11] repository.flowgen[12] supports most of the TypeScript syntax, however, in some cases manual changes may be needed before use.You can check out supported syntax constructs in flowgen's “The state of converter” section[13].After you have edited these files, consider contributing[14] them back to flow-typed.Active Maintenance Team | | | :---:|:---:|:---:|:---:@AndrewSouthpaw | @GAntoine | @pascalduez | @villesau[15][16][17][18] To restore the repository download the bundle wget https://archive.org/download/github.com-flow-typed-flow-typed_-_2021-02-28_02-52-49/flow-typed-flow-typed_-_2021-02-28_02-52-49.bundle and run: git clone flow-typed-flow-typed_-_2021-02-28_02-52-49.bundle Source: https://github.com/flow-typed/flow-typed[19]Uploader: flow-typed[20]Upload date: 2021-02-28 References^ repository (github.com)^ library interface definitions (flow.org)^ Flow (flow.org)^ library definitions (flow.org)^ Importing And Using Type Definitions (github.com)^ FAQs (github.com)^ open an issue (github.com)^ Contributing Library Definitions (github.com)^ CONTRIBUTING.md (github.com)^ CLI Commands & Flags (github.com)^ flowgen (github.com)^ flowgen (github.com)^ “The state of converter” section (github.com)^ contributing (archive.org)^ @AndrewSouthpaw (github.com)^ @GAntoine (github.com)^ @pascalduez (github.com)^ @villesau (github.com)^ https://github.com/flow-typed/flow-typed (github.com)^ flow-typed (github.com)

weiterlesen: RSS Quelle öffnen