{"_id":"ast-types-flow","_rev":"10-5c9a37f137cb09f76bcdb09aaa860e04","name":"ast-types-flow","description":"Flow types for the Javascript AST","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"ast-types-flow","version":"0.0.1","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"b3401e2634266d424c11b66c34279adfe4fe3de0","_id":"ast-types-flow@0.0.1","_shasum":"a1271377d54726c6ce4c744f2e07248300c5754e","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"a1271377d54726c6ce4c744f2e07248300c5754e","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.1.tgz","integrity":"sha512-e7afy51fU4/CK/6LveowanBtMenK+Nz17fHSoJvKp0VagSXtrFiFOvjjFxZ6+CvKHvctoedr6+f6RQJ2b5nDRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGEWCRmSKZJmOpWW38OXtcPT6TM95O8c6A1mUYh2n2RAAiBeBTdKtwhZ8kO6pDbBcWzCCu7Z36LjMDlln9pQPxpUbA=="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.2":{"name":"ast-types-flow","version":"0.0.2","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"79fbc67368fea4e027db4dcac847008520102919","_id":"ast-types-flow@0.0.2","_shasum":"4c149675409163e4780b498ace4f840418d9612e","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"4c149675409163e4780b498ace4f840418d9612e","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.2.tgz","integrity":"sha512-RXHVOh3nRpy/o6DqEOsET0ZMuztgABQoIfdZ2l0EqsxZWJ+KRqMI1GajgfiDWdAf9HU3LG2cLtNJdyQRqG9zdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjiN0DWg1Xo/3MnwsohQxRHXy/iKf7Tk5aP4swgbXGcAIgLddyMRj26k3vpn6w9jyOZmaw5nw0l5N/+S470jkiNIQ="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.3":{"name":"ast-types-flow","version":"0.0.3","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"25e58c054d5011afe48fac9f3bc54e288278ec2c","_id":"ast-types-flow@0.0.3","_shasum":"d92ac303170523449f5b45632c37186c9aab9807","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"d92ac303170523449f5b45632c37186c9aab9807","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.3.tgz","integrity":"sha512-Uuhy4PaY60I6uKMFiIaFI0wYmyPNL8edRMUXtwq4qJGPAHVGwrpR6SyQgm1EvwnKtA+j9XGbY02dAz2wzT7x0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsKgIr93QHVwqHKnRH6dTRGuH373SvQ197lTScWSbQjAiA44DKY3qp1ioD7L2OJhvx/BJIVovtLfYUbs3a2+euRoA=="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.4":{"name":"ast-types-flow","version":"0.0.4","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"ef2e32cb0a3224e693208de5eb2d224d644d9761","_id":"ast-types-flow@0.0.4","_shasum":"92cd7f99221dc483fe377f862cc6dae836889231","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"92cd7f99221dc483fe377f862cc6dae836889231","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.4.tgz","integrity":"sha512-5SOc9O0sWz8Ot+qGmBsU/f8A8+ufXAONqbmCtv2G2zlS0CZY1j5cCnvmqVDa0NhZtO4DjmyHKExsf2p7lhYWuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3Ac8ZZHd/SNassOR/ZOI70885hcUdAJNxo4m6ntPkDAiEA72xYDJT9JchXMWq5ZjO3Jn9vUQeokZmwq+jURHzEm/U="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.5":{"name":"ast-types-flow","version":"0.0.5","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"f31c41130d9d37140ec42babe1e39298a7365013","_id":"ast-types-flow@0.0.5","_shasum":"2fad49ef51c3b41c8b3d54f2c771bf2e97a9e984","_from":".","_npmVersion":"2.14.8","_nodeVersion":"4.2.1","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"2fad49ef51c3b41c8b3d54f2c771bf2e97a9e984","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.5.tgz","integrity":"sha512-m6Ba+1t4I4/1bFh3kpDsmUEyqaKCTs1ORy6AXZMUfsMuP+9Rr7Ex0YjJZ1nOmoFlsZnEp4XhvR72r9z2KQPgmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGV9OpTkEiDnKuI/HEWKbt2GOqx1TwNryTzb9JcyuOhwAiAD40NHCsxH0Gbwe8gJFcSBP5MhVBi4WNI3xy54sBloiw=="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.6":{"name":"ast-types-flow","version":"0.0.6","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"0e1286e31f987abf7b228efdbbc9a600be38047c","_id":"ast-types-flow@0.0.6","_shasum":"6e334ba2637f3d5f63a1ad59aca7340536eacfd6","_from":".","_npmVersion":"2.14.8","_nodeVersion":"4.2.1","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"6e334ba2637f3d5f63a1ad59aca7340536eacfd6","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.6.tgz","integrity":"sha512-cNHwoDycoAvjSjwX/BROV9dBVAsPbX6V8JJlVEJTimGzP4ubF89j5hFq30xiK3DOOixV4ypIZz+bWbMVPehVrQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxNvYRXp1417xun7y9HJbAnbNynqVNJbBio8hwxdX7IAiEAsszq0CRal0fwN71tFvRbZFCwmCTBat1YhAODABsyBls="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.7":{"name":"ast-types-flow","version":"0.0.7","description":"Flow types for the Javascript AST","main":"lib/types.js","files":["lib"],"scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"ISC","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"003086278fe72acf0c9ecc12e569a3ec01c4f0af","_id":"ast-types-flow@0.0.7","_shasum":"f70b735c6bca1a5c9c22d982c3e39e7feba3bdad","_from":".","_npmVersion":"2.14.8","_nodeVersion":"4.2.1","_npmUser":{"name":"kyldvs","email":"kyldvs@gmail.com"},"dist":{"shasum":"f70b735c6bca1a5c9c22d982c3e39e7feba3bdad","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz","integrity":"sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwIe+ffbufnjgsAAs5Jx6BgIkcSrZ5yzsq/28XqX6elAiEAxjCqNi9192KUk2gV0u4kpU1FnLsmcBOIIXx9AihMO6U="}]},"maintainers":[{"name":"kyldvs","email":"kyldvs@gmail.com"}],"directories":{}},"0.0.8":{"name":"ast-types-flow","version":"0.0.8","description":"Flow types for the Javascript AST","main":"lib/types.js","scripts":{"build":"gulp build","test":"flow"},"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"keywords":["flow","ast","javascript"],"author":{"name":"kyldvs"},"license":"MIT","bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","devDependencies":{"gulp":"^3.9.0","gulp-util":"^3.0.6","jscodeshift":"^0.3.7","nuclide-node-transpiler":"0.0.30","through2":"^2.0.0"},"gitHead":"7890bc46dc5fb5b0009792851f698972359adcc2","_id":"ast-types-flow@0.0.8","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==","shasum":"0a85e1c92695769ac13a428bb653e7538bea27d6","tarball":"https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz","fileCount":4,"unpackedSize":125975,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELl9mDPFjwgWWaYeCfddwnoSu+Jf1jRBUFIN4cxDnneAiBxbFgq3f2kf/Fp89yAYzo1wC42tVZd0EyW7vojEdFETA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOfD4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/sw/+MZZNP/T8xH4hihi6ZFs84LzQhripI9rBbAzoPRAirKHRyq0n\r\nLxMZGeTnvNB0phT8fez//6kxJjBvB3h1eF9J8E/kfzboB0Y4hYVNHhpot72p\r\nQHUIWiUoBNJUcSqF8OeqjxNS76pjSwP/nLDCsGKGFOTA3ZQ0IpFUFN8R2b31\r\nHP1tm/Mp/WDYPLlQSE+UUv+Y547ZoblT1C+4+qBo1jqBjy5IO9j/MfCSfLI+\r\nFYnlhanulRsIVhunqdlvm1d0LQLuxyBapegpp0RR7zcHl2lhaIaWy+tkMyXM\r\ns0rqJVxWuorK+HB6VzxW7/WDHnY+oYUA5HugmgyRkPOLX1a8zYNmknrx7IyG\r\nzLEsUqGNw2gvF/8Amyja+zxJ/z2IurUol8QcOT8oPHe5oAuKHWp8cVKEoAtJ\r\nTucxs3lVyifVfSykXhSSd7eso0zoiZOMgD3y32ZMHdjUNE3/LRyAHVYnSd2z\r\n1mUGo6iERtTuG8WOpWXkCtIaX+CuTuyiSgnejmrhuk1RkAFbBJs4tR22CiAa\r\nI+JSynWlsIffy/oj3vYyIX/TRtMN0/vMC39VsXPXr3ZDDp+CXTt0R0Evllra\r\n4KbJncPrjkldJQiKHDhvSuBcMc96S9U/gom2TatS895sMXbffaP/1r6NA/F3\r\nedewlXJ+NjJq8vSu66O/fvvH319FGCsVgiY=\r\n=qlYR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kyldvs","email":"npm@kyle.dev"},"directories":{},"maintainers":[{"name":"kyldvs","email":"npm@kyle.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ast-types-flow_0.0.8_1681518840161_0.13803071524510813"},"_hasShrinkwrap":false}},"readme":"# ast-types-flow\n\nFlow types for the Javascript AST. Based off of [benjamn/ast-types](https://github.com/benjamn/ast-types).\n\n## Usage\n\nFirst install `ast-types-flow` via npm, then you can import any of the types\nthat are exported.\n\n```javascript\n/* @flow */\n\nimport type {Node} from 'ast-types-flow';\n\nfunction getName(node: Node): string {\n  switch (node.type) {\n    case 'Identifier':\n      return node.name;\n\n    case 'ClassDeclaration':\n      return node.id.name; // Error, id could be null.\n\n    case 'FunctionDeclaration':\n      return node.id.name; // Fine if it's always there.\n\n    case 'FunctionExpression':\n      if (node.id) {\n        return node.id.name; // Can refine id to make sure it exists.\n      } else {\n        return 'Unknown';\n      }\n\n    case 'Literal':\n      return node.name; // Error, Literals don't have names, don't be silly.\n  }\n  return 'Unknown';\n}\n```\n\n## How it works\n\nA notion of \"extends\" is added to the Flow syntax via comments. A transform is\nincluded that will compile the source code into useful disjoint union types\nbased on how the different types extend each other. For example:\n\n```javascript\ntype Node = {\n  common: string,\n};\n\ntype Foo = {\n  // extends Node\n  foo: string,\n};\n\ntype Bar = {\n  // extends Node\n  bar: number,\n};\n```\n\nWill be transformed into:\n\n```javascript\ntype Node = {\n  type: 'Foo',\n  _Foo: void,\n  common: string,\n  foo: string,\n} | {\n  type: 'Bar',\n  _Bar: void,\n  common: string,\n  bar: number,\n};\n\ntype Foo = {\n  type: 'Foo',\n  _Foo: void,\n  common: string,\n  foo: string,\n};\n\ntype Bar = {\n  type: 'Bar',\n  _Foo: void,\n  common: string,\n  bar: number,\n};\n```\n\nA few things to note:\n\n1. The type `Node` would more ideally be compiled into `Foo | Bar` but then the\ndisjoint union cannot be properly refined. For now we have to duplicate the\ncomplete definitions.\n2. Each entry in a disjoint union has to be structurally unique or Flow will\nhave an error on the definition. That is why the private `_Foo: void` fields\nappear in the types.\n","maintainers":[{"name":"kyldvs","email":"npm@kyle.dev"}],"time":{"modified":"2023-04-15T00:34:00.460Z","created":"2015-09-14T04:06:13.677Z","0.0.1":"2015-09-14T04:06:13.677Z","0.0.2":"2015-09-14T04:16:27.173Z","0.0.3":"2015-09-14T04:20:17.961Z","0.0.4":"2015-09-30T04:24:40.694Z","0.0.5":"2015-10-28T02:18:39.697Z","0.0.6":"2015-10-28T02:20:43.702Z","0.0.7":"2015-10-30T06:48:44.166Z","0.0.8":"2023-04-15T00:34:00.324Z"},"homepage":"https://github.com/kyldvs/ast-types-flow#readme","keywords":["flow","ast","javascript"],"repository":{"type":"git","url":"git+https://github.com/kyldvs/ast-types-flow.git"},"author":{"name":"kyldvs"},"bugs":{"url":"https://github.com/kyldvs/ast-types-flow/issues"},"license":"MIT","readmeFilename":"README.md"}