Coder Social home page Coder Social logo

ronami / meta-typing Goto Github PK

View Code? Open in Web Editor NEW
1.5K 1.5K 25.0 1.67 MB

๐Ÿ“š Functions and algorithms implemented purely with TypeScript's type system

License: MIT License

TypeScript 100.00%
algorithms example functional learning recursion type-system typescript

meta-typing's People

Contributors

nickheiner avatar ranyitz avatar ronami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta-typing's Issues

Question for help with typing

Good afternoon. Great repository, thanks.

This question sounds more like a request for help. If you have the time and desire to help.

I'm doing a library that helps with organizing logic and business tasks.
https://github.com/avil13/vue-act-master

And I'm having a serious problem.

I create an action, and I call it through the manager.

But when I call it, I can't get the return type of the function.

Example code:

import { ActMaster, ActMasterAction } from 'act-master';

class GetUserAction implements ActMasterAction {
  name = 'get.user';

  async exec() {
    return { name: 'My Name' }
  }
}

const actions: actMasterAction[] = [new GetUserAction()];

constMaster = new ActMaster({
  actions,
});

// Here is the gist of this question
// I would like the names of the actions to be prompted
// and the type of result return
actMaster.exec('get.user');

Is it possible to create a declaration based on code?
Or create an interface that tells you the name of the action and the return result.

I tried to do something like that, but the attempt failed.

interface ActionList {
  'get.user': { name: string };
}

type exec = (name: keyof ActionList) => ActionList[keyof ActionList];

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.