Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect types for setters in Core #35

Closed
mgred opened this issue Feb 16, 2018 · 0 comments
Closed

Incorrect types for setters in Core #35

mgred opened this issue Feb 16, 2018 · 0 comments

Comments

@mgred
Copy link
Collaborator

mgred commented Feb 16, 2018

The setters of the Core class are wrongly typed in the declaration file index.d.ts

declare class Core {
    debug: void;
    baseURL: void;
    modelName: void;
    routeDelimiter: void;
    caseSensitive: void;
}

Therefore the typescript compiler complains at the following code:

import { Rapid } from 'rapid.js';

class Resource extends Rapid {
        boot() {
                this.modelName = 'my-resource';
        }
}

with the following error:

error TS2322: Type '"my-resource"' is not assignable to type 'void'

According to the defaults.js they simply need to have this types defined:

declare class Core {
    debug: boolean;
    baseURL: string;
    modelName: string;
    routeDelimiter: string;
    caseSensitive: boolean;
}
mgred added a commit to mgred/rapid.js that referenced this issue Feb 16, 2018
This sets the correct types for the setters defined in Core
issue rapidjs#35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants