Code Monkey home page Code Monkey logo

typal's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

typal's Issues

filter out primitives from warnings

Type number not found
Type string not found
Type Array<string> not found
Type string not found
Type string? not found
Type Array<string> not found
Type Array<string> not found
Detected type marker: types/compile.xml
Detected type marker: types/index.xml
Detected type marker: types/options.xml
Type Array<string> not found
Type (string):string not found
Type string not found
Type Array<string> not found
Type boolean not found
Type Array<_staticAnalysis.Detection> not found
Detected type marker: types/index.xml
Type Array<string> not found
Type Array<string> not found
Type Array<!_staticAnalysis.Detection> not found
Type Array<string> not found

embed types

embed by directive in XML rather than having to manually type what to commit

the text moves

after embedding the types the text moves so that warnings will have incorrect line numbers

Cannot extract

/**

  • @typedef {Object} users.address.getInfo
  • @prop {number} id ID of the address.
  • @typedef Address
  • @prop {number} AddressID A unique integer value that represents the address profile.
  • @prop {number} AddressName The name of the address profile.
  • @prop {boolean} IsDefault Whether it is a default address.
    */

write parser for jsdoc

Change from a RegExp to a parser
2 problems ATM:

  • Can't check the record type in @param
    /** @param {{ record }} param
    
  • Matching the param name which starts the same as one of the previous params
    /**
     * @param {(Type | _ns.MissingType | _ns.Type)} union
     * @param {Type | MissingType} unionWithoutParenthesis

introduce the constructor property

For constructors, types and interfaces, there needs to be an extra field called constructor to declare the type of the constructor method.

Implement inheritance

<type name="Message" desc="A TypeScript Server message">
    <prop number name="seq">
      Sequence number of the message
    </prop>
    <prop name="type" type="'request'|'response'|'event'">
      One of "request", "response", or "event"
    </prop>
  </type>
<type name="Event" desc="Server-initiated event message" extends="Message">
    <prop name="type" type="'event'" />
    <prop string name="event">
      Name of event
    </prop>
    <prop opt name="body">
      Event-specific information
    </prop>
  </type>

automatically create constructor jsdoc in template

const { _Cookies, connect, express, _Keygrip } = require('./cookies')

/**
 * The interface for Cookies: signed and unsigned cookies based on Keygrip.
 * @type {new (req: !http.IncomingMessage, res: !http.ServerResponse, opts: !_goa.CookiesOptions) => Cookies}
 */
const $Cookies = _Cookies

/**
 * Signing and verifying data (such as cookies or URLs) through a rotating credential system.
 * @type {new (keys: !Array<string>, algorithm?: string, encoding?: string) => Keygrip}
 */
const $Keygrip = _Keygrip

async method output in typedef

no promise is printed right now

<method async name="askSingle" return="string">
    <arg type="(string|!_reloquent.Question)" name="question">
      The question to present to the user.
    </arg>
    <arg type="number" name="timeout" opt>
      How long to wait before rejecting the promise. Waits forever by default.
    </arg>
    Ask user a question via the CLI. Returns the answer to the question. 
    If a timeout is passed, the promise will expire after the specified 
    number of milliseconds if the answer was not given.
  </method>

ignore props

for example, we want to override a property with NO PROPERTY, like here we want to ignore session

/* typal node_modules/@idio/github/types/index.xml namespace ignore:_goa.Middleware,_idio.Context */
/**
 * @typedef {_idio.GithubOAuthConfig} GithubOAuthConfig `@record` Options for the program.
 * @typedef {Object} _idio.GithubOAuthConfig `@record` Options for the program.
 * @prop {string} client_id The app's client id.
 * @prop {string} client_secret The app's client secret.
 * @prop {string} [path="/auth/github"] The server path to start the login flaw at and use for redirect (`${path}/redirect`). Default `/auth/github`.
 * @prop {string} [scope] The scope to ask permissions for. No scope by default.
 * @prop {!_goa.Middleware} [session] The configured session middleware in case the `session` property is not globally available on the context.
 * @prop {(ctx: _idio.Context, token: string, scope: string, user: !_idio.GithubUser, next: function()) => !Promise} [finish="setSession; redirect;"] The function to complete the authentication that receives the token and the data about the user, such as name and id. The default function redirects to `/`. Default `setSession; redirect;`.
 * @prop {(ctx: !_idio.Context, error: string, description: string, next: function()) => !Promise} [error="throw;"] The function to be called in case of error. If not specified, the middleware will throw an internal server error. Default `throw;`.
 */

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.