Giter Club home page Giter Club logo

Comments (4)

maroon1 avatar maroon1 commented on August 11, 2024 1

发现我也可以直接在 index.d.ts 中直接重写 model 的定义,然后就可以用自动生成的类型定义

from egg-ts-helper.

whxaxes avatar whxaxes commented on August 11, 2024

给个稳定复现的 repo,我看一下

from egg-ts-helper.

whxaxes avatar whxaxes commented on August 11, 2024

如果你不想生成 model 的,在 package.json 中配置一下就行了

{
  "name": "app",
  "egg": {
    "tsHelper": {
      "watchDirs": {
        "model": false
      }
    }
  }
}

from egg-ts-helper.

whxaxes avatar whxaxes commented on August 11, 2024

目前自动生成的 d.ts 是这样的

import Person from '../../../app/model/Person';
import User from '../../../app/model/User';

declare module 'sequelize' {
  interface Sequelize {
    Person: ReturnType<typeof Person>;
    User: ReturnType<typeof User>;
  }
}

是哪里会引起兼容问题?

from egg-ts-helper.

Related Issues (20)

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.