I am facing an issue with my npm package setup. Here is a snippet from one of the files:
'use strict'
module.exports = class TModel {
constructor (app) {
this.app = app
}
static schema () {
}
}
I am trying to incorporate this into a Typescript file like this:
import Model from 't-model';
export class Book extends Model {
static schema() : any {
return {
title: {
type: 'string'
}
}
}
}
Unfortunately, I am encountering errors. PHPStorm displays the message:
Cannot resolve file
Additionally, when compiling with tsc, I receive the error:
error TS2307: Cannot find module 't-model'
Even after attempting to switch to 't-model/index'
, PHPStorm stopped showing an error but tsc still raises the same issue.
I am striving to create cohesive packages that work for both backend APIs and front-end applications using Typescript. Is there a solution to this merging dilemma?