Giter VIP home page Giter VIP logo

ts-gir's Introduction

ts-gir

GitHub stars

generate typescript from gir

Please ★ this repo if you found it useful ★ ★ ★

Features

  • supports gir
  • supports typescript

Installation

npm install -g ts-gir

Dependencies

Usage

ts-gir --help
generate typescript from gir

USAGE
  $ ts-gir

OPTIONS
  -d, --dir=dir        Output dir
  -h, --help           show CLI help
  -i, --inputs=inputs  (required) [default: /usr/share/gir-1.0/*.gir] Paths to GIR files to generate type definitions from (with wild card support)
  -m, --module=module
  -o, --output=output  Output basename, if not set, the namespace is used
  -s, --silent
  -v, --version        show CLI version
  --verbose

Contribute usage docs

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2019

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons

Related Projects

TypeScript Type Definitions

Other

ts-gir's People

Contributors

clayrisser avatar ganarepository avatar jumplink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ts-gir's Issues

Fails to generate when one of the gir class starts with a number

Fails to generate when one of the gir class starts with a number. Please check the log.

`› Warning: unknown type 'MathExpression' set to 'any'
› Warning: unknown type 'MathConstant' set to 'any'
› Warning: unknown type 'MathVariable' set to 'any'
› Warning: unknown type 'MathResult' set to 'any'
› Warning: unknown type 'MathEquationManager' set to 'any'
› Warning: unknown type 'Hashable' set to 'any'
› Warning: unknown type 'MathConstantComplex' set to 'any'
› Warning: unknown type 'MathConstantNumber' set to 'any'
› Warning: unknown type 'MathEquation' set to 'any'
› Warning: unknown type 'MathErrorResult' set to 'any'
› Warning: unknown type 'MathFunction' set to 'any'
› Warning: unknown type 'MathGroup' set to 'any'
› Warning: unknown type 'MathParameter' set to 'any'
› Warning: unknown type 'MathPolynomial' set to 'any'
› Warning: unknown type 'MathTerm' set to 'any'
› Warning: importing 'GObject' from './g-object'
› Warning: importing 'Gee' from './gee'
› Warning: unknown type 'GType' set to 'any'
› Warning: unknown type 'filename' set to 'any'
› Warning: unknown type 'ChildProxy' set to 'any'
› Warning: property 'package' renamed to 'g_package' in class 'PluginDesc'
› Warning: method 'new' renamed to 'g_new' in class 'Poll'
› Warning: unknown type 'Preset' set to 'any'
› Warning: property 'string' renamed to 'g_string' in class 'StaticCaps'
› Warning: unknown type 'URIHandler' set to 'any'
› Warning: importing 'GLib' from './g-lib'
› Warning: unknown type 'guintptr' set to 'any'
› Warning: unknown type 'PhysMemoryAllocator' set to 'any'
› Warning: importing 'Gst' from './gst'
› Warning: importing 'GstBase' from './gst-base'
› Warning: method 'new' renamed to 'g_new' in class 'AudioChannelMixer'
› Warning: method 'new' renamed to 'g_new' in class 'AudioQuantize'
› Warning: method 'new' renamed to 'g_new' in class 'AudioResampler'
› Warning: method 'new' renamed to 'g_new' in class 'BitReader'
› Warning: method 'new' renamed to 'g_new' in class 'BitWriter'
› Warning: method 'new' renamed to 'g_new' in class 'ByteReader'
› Warning: method 'new' renamed to 'g_new' in class 'ByteWriter'
› Warning: method 'new' renamed to 'g_new' in class 'QueueArray'
› Warning: method 'new' renamed to 'g_new' in class 'Harness'
› Warning: property 'function' renamed to 'g_function' in class 'GLAsyncDebug'
› Warning: method 'new' renamed to 'g_new' in class 'GLAsyncDebug'
› Warning: method 'new' renamed to 'g_new' in class 'GLQuery'
› Warning: importing 'GstVideo' from './gst-video'
› Warning: $callbacks is not an array: {
› "@_name": "PtpStatisticsCallback",
› "@_c:type": "GstPtpStatisticsCallback",
› "doc": {
› "#text": "The statistics can be the following structures:\n\nGST_PTP_STATISTICS_NEW_DOMAIN_FOUND:\n"domain" G_TYPE_UINT The domain identifier of the domain\n"clock"
› GST_TYPE_CLOCK The internal clock that is slaved to the\n PTP domain\n\nGST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED:\n"domain"
› G_TYPE_UINT The domain identifier of the domain\n"master-clock-id" G_TYPE_UINT64 PTP clock identifier of the selected master\n
› clock\n"master-clock-port" G_TYPE_UINT PTP port number of the selected master clock\n"grandmaster-clock-id" G_TYPE_UINT64 PTP clock identifier of the
› grandmaster clock\n\nGST_PTP_STATISTICS_PATH_DELAY_MEASURED:\n"domain" G_TYPE_UINT The domain identifier of the domain\n"mean-path-delay-avg" GST_TYPE_CLOCK_TIME
› Average mean path delay\n"mean-path-delay" GST_TYPE_CLOCK_TIME Latest mean path delay\n"delay-request-delay" GST_TYPE_CLOCK_TIME Delay of DELAY_REQ / DELAY_RESP
› messages\n\nGST_PTP_STATISTICS_TIME_UPDATED:\n"domain" G_TYPE_UINT The domain identifier of the domain\n"mean-path-delay-avg" GST_TYPE_CLOCK_TIME Average mean path
› delay\n"local-time" GST_TYPE_CLOCK_TIME Local time that corresponds to ptp-time\n"ptp-time" GST_TYPE_CLOCK_TIME Newly measured PTP time at
› local-time\n"estimated-ptp-time" GST_TYPE_CLOCK_TIME Estimated PTP time based on previous measurements\n"discontinuity" G_TYPE_INT64 Difference between estimated and
› measured PTP time\n"synced" G_TYPE_BOOLEAN Currently synced to the remote clock\n"r-squared" G_TYPE_DOUBLE R² of clock estimation
› regression\n"internal-time" GST_TYPE_CLOCK_TIME Internal time clock parameter\n"external-time" GST_TYPE_CLOCK_TIME External time clock parameter\n"rate-num"
› G_TYPE_UINT64 Internal/external rate numerator\n"rate-den" G_TYPE_UINT64 Internal/external rate denominator\n"rate" G_TYPE_DOUBLE
› Internal/external rate\n\nIf %FALSE is returned, the callback is removed and never called again.",
› "@_xml:space": "preserve",
› "@_filename": "gstptpclock.h",
› "@_line": "99"
› },
› "source-position": {
› "@_filename": "gstptpclock.h",
› "@_line": "143"
› },
› "return-value": {
› "@_transfer-ownership": "none",
› "type": {
› "@_name": "gboolean",
› "@_c:type": "gboolean"
› }
› },
› "parameters": {
› "parameter": [
› {
› "@_name": "domain",
› "@_transfer-ownership": "none",
› "doc": {
› "#text": "PTP domain identifier",
› "@_xml:space": "preserve",
› "@_filename": "gstptpclock.h",
› "@_line": "101"
› },
› "type": {
› "@_name": "guint8",
› "@_c:type": "guint8"
› }
› },
› {
› "@_name": "stats",
› "@_transfer-ownership": "none",
› "doc": {
› "#text": "New statistics",
› "@_xml:space": "preserve",
› "@_filename": "gstptpclock.h",
› "@_line": "102"
› },
› "type": {
› "@_name": "Gst.Structure",
› "@_c:type": "const GstStructure*"
› }
› },
› {
› "@_name": "user_data",
› "@_transfer-ownership": "none",
› "@_nullable": "1",
› "@_allow-none": "1",
› "@_closure": "2",
› "doc": {
› "#text": "Data passed to gst_ptp_statistics_callback_add()",
› "@_xml:space": "preserve",
› "@_filename": "gstptpclock.h",
› "@_line": "103"
› },
› "type": {
› "@_name": "gpointer",
› "@_c:type": "gpointer"
› }
› }
› ]
› }
› }
› Warning: importing 'Gio' from './gio'
› Warning: importing 'GstAudio' from './gst-audio'
› Warning: method 'new' renamed to 'g_new' in class 'RTCPBuffer'
› Warning: unknown type 'RTSPExtension' set to 'any'
› Warning: method 'new' renamed to 'g_new' in class 'RTSPTransport'
› Warning: method 'new' renamed to 'g_new' in class 'RTSPWatch'
› Warning: $callbacks is not an array: {
› "@_name": "RTSPConnectionAcceptCertificateFunc",
› "@_c:type": "GstRTSPConnectionAcceptCertificateFunc",
› "source-position": {
› "@_filename": "gstrtspconnection.h",
› "@_line": "113"
› },
› "return-value": {
› "@_transfer-ownership": "none",
› "type": {
› "@_name": "gboolean",
› "@_c:type": "gboolean"
› }
› },
› "parameters": {
› "parameter": [
› {
› "@_name": "conn",
› "@_transfer-ownership": "none",
› "type": {
› "@_name": "Gio.TlsConnection",
› "@_c:type": "GTlsConnection*"
› }
› },
› {
› "@_name": "peer_cert",
› "@_transfer-ownership": "none",
› "type": {
› "@_name": "Gio.TlsCertificate",
› "@_c:type": "GTlsCertificate*"
› }
› },
› {
› "@_name": "errors",
› "@_transfer-ownership": "none",
› "type": {
› "@_name": "Gio.TlsCertificateFlags",
› "@_c:type": "GTlsCertificateFlags"
› }
› },
› {
› "@_name": "user_data",
› "@_transfer-ownership": "none",
› "@_nullable": "1",
› "@_allow-none": "1",
› "@_closure": "3",
› "type": {
› "@_name": "gpointer",
› "@_c:type": "gpointer"
› }
› }
› ]
› }
› }
› Warning: method 'new' renamed to 'g_new' in class 'SDPMedia'
› Warning: method 'new' renamed to 'g_new' in class 'SDPMessage'
› Warning: unknown type 'ColorBalance' set to 'any'
› Warning: unknown type 'Navigation' set to 'any'
› Warning: empty method name in class 'VideoChromaResample'
› Warning: method 'new' renamed to 'g_new' in class 'VideoChromaResample'
› Warning: method 'new' renamed to 'g_new' in class 'VideoConverter'
› Warning: method 'new' renamed to 'g_new' in class 'VideoDither'
› Warning: unknown type 'VideoOrientation' set to 'any'
› Warning: unknown type 'VideoOverlay' set to 'any'
(node:77764) UnhandledPromiseRejectionWarning: SyntaxError: Identifier directly after number. (2:14)
1 | /* @babel/template */;

2 | class Class {2d(): void}
| ^
at Object._raise (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:807:17)
at Object.raiseWithData (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:800:17)
at Object.raise (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:761:17)
at Object.readNumber (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:9255:18)
at Object.getTokenFromCode (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:8951:14)
at Object.getTokenFromCode (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:5248:18)
at Object.getTokenFromCode (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:7753:20)
at Object.getTokenFromCode (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:7947:18)
at Object.nextToken (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:8483:12)
at Object.next (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:8413:10)
at Object.eat (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:8418:12)
at Object.expect (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:9905:10)
at Object.parseClassBody (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:13248:10)
at Object.parseClass (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:8051:60)
at Object.parseStatementContent (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:12507:21)
at Object.parseStatementContent (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/@babel/parser/lib/index.js:7237:18)
=============
at GirTSGenerator.templateAst (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/babel-parser-generator/lib/index.js:67:39)
at GirTSGenerator.append (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/node_modules/babel-parser-generator/lib/index.js:87:28)
at /home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:370:30
at Array.forEach ()
at GirTSGenerator.buildMethodDeclarations (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:341:14)
at /home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:286:12
at Array.forEach ()
at GirTSGenerator.buildClassDeclarations (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:260:21)
at GirTSGenerator.buildModules (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:130:10)
at GirTSGenerator.build (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/GirTSGenerator.js:49:10)
at /home/user/.nvm/versions/node/v14.16.1/lib/node_modules/ts-gir/lib/TSGir.js:108:26
at Generator.next ()
at asyncGeneratorStep (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
(Use node --trace-warnings ... to show where the warning was created)
(node:77764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:77764) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.