• module-plugin.d.ts

    module-plugin.d.ts

    1. // Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]
    2. // Project: [~THE PROJECT NAME~]
    3. // Definitions by: [~YOUR NAME~] <[~A URL FOR YOU~]>
    4. /*~ This is the module plugin template file. You should rename it to index.d.ts
    5. *~ and place it in a folder with the same name as the module.
    6. *~ For example, if you were writing a file for "super-greeter", this
    7. *~ file should be 'super-greeter/index.d.ts'
    8. */
    9. /*~ On this line, import the module which this module adds to */
    10. import * as m from 'someModule';
    11. /*~ You can also import other modules if needed */
    12. import * as other from 'anotherModule';
    13. /*~ Here, declare the same module as the one you imported above */
    14. declare module 'someModule' {
    15. /*~ Inside, add new function, classes, or variables. You can use
    16. *~ unexported types from the original module if needed. */
    17. export function theNewMethod(x: m.foo): other.bar;
    18. /*~ You can also add new properties to existing interfaces from
    19. *~ the original module by writing interface augmentations */
    20. export interface SomeModuleOptions {
    21. someModuleSetting?: string;
    22. }
    23. /*~ New types can also be declared and will appear as if they
    24. *~ are in the original module */
    25. export interface MyModulePluginOptions {
    26. size: number;
    27. }
    28. }