You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Vladimir Kotikov (Akvelon)" <v-...@microsoft.com> on 2017/01/09 13:23:11 UTC

[DISCUSS] Include TypeScript definitions in plugins

Hey, everybody!

I’d like to propose/discuss the idea of redistributing Typescript definitions along with core plugins, so that users who write their apps in Typescript would get the typings in their projects without additional mess with 'tsd'/'typings' (these all are the package managers for typescript declarations) or manual installation from '@types' NPM org.

As mentioned above, our main goal - to reduce the number of additional actions needed to either add the plugin to Typescript project or get the types information and intellisense for JavaScript projects. Also, this would reduce the number of network calls to other services (typings registry, NPM registry) which are known as common points of denial (per telemetry data).

The changes are pretty minimal and include adding a d.ts file with type definitions (taken from DefinitelyTyped[1]) and 'types' entry to package.json according to Typescript convention [2]. The sample implementation for camera plugin is here: https://github.com/apache/cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings

Does anyone have any considerations/objections about this proposal?

-
[1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/cordova-plugin-camera/index.d.ts
[2] http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

-
Best regards, Vladimir



-
Best regards, Vladimir
 


Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Frederico Galvão <fr...@pontoget.com.br>.
Vladimir, I was recently questioned about this goal/topic on the .d.ts for
phonegap-push-plugin I maintain on DT, and the question I have now is:
How long will we have to maintain both in-house and DT versions for?
Is it a plan to remove them from DT once they are stable at home? How's the
landscape for type definitions in this regard?
I'd like yours, or anyone else's input on this issue if possible:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16133

2017-01-17 18:35 GMT-02:00 Котиков Владимир <ko...@gmail.com>:

> Hey guys!
>
> I’m excited to see such positive feedback ☺ This sounds like a consensus,
> so we’re going to publish the PRs to the core plugins in a couple of days.
>
> Also, a bit of technical details:
>   - as Mike mentioned, typescript definitions are not necessarily need to
> be placed at the root of package – the package just need to have “types”
> entry in package.json, pointing to the typings location – so the proposed
> approach is to have “types”/”typings” directory at the root with
> “index.d.ts” file in it
>   - the typings in core plugins will coexist with the ones from
> DefinitelyTyped repository – this shouldn’t be a big deal from maintenance
> perspective as the plugin APIs are already stable and I suspect they won’t
> be changing often. We just need to make sure that if anyone changes the
> public API of the plugin, he/she will need to update DefinitelyTyped as
> well as typings in the plugin.
>
> -
> Best regards, Vladimir
>
>
> On 1/10/17, 05:02, "Steven Gill" <st...@gmail.com> wrote:
>
>     DO ITTT
>
>     On Mon, Jan 9, 2017 at 5:04 PM, Frederico Galvão <
>     frederico.galvao@pontoget.com.br> wrote:
>
>     > Please do!
>     >
>     > 2017-01-09 20:40 GMT-02:00 Mike Hartington <mikehartington@gmail.com
> >:
>     >
>     > > Types can be in sub-folder.
>     > > As long as the type entried just points to the path
>     > >
>     > > https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.typescriptlang.org%2Fdocs%2Fhandbook%2Fdeclaration-&
> data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fc
> bd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%
> 7C636196105543207234&sdata=hqPuvVmtxIujvkxHMBKOLjcUkblK1S
> ASy68AtA9Nr7k%3D&reserved=0
>     > > files/publishing.html <https://na01.safelinks.
> protection.outlook.com/?url=https%3A%2F%2Fwww.typescriptlang&data=02%7C01%
> 7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%
> 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=
> fPB1Zkl2t7GquW0Fbtd9qu2y0oKh%2BpO9i1EkdNYyPqI%3D&reserved=0.
>     > > org/docs/handbook/declaration-files/publishing.html>
>     > >
>     > >
>     > > Mike Hartington
>     > >
>     > >
>     > >
>     > > > On Jan 9, 2017, at 5:38 PM, Victor Sosa <so...@gmail.com>
>     > wrote:
>     > > >
>     > > > +1... I love this idea! Will help a lot to static analysis tools
> and
>     > > IDEs.
>     > > >
>     > > > On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com>
> wrote:
>     > > >
>     > > >> Thanks for bringing this up Vladimir,
>     > > >> +1 -- but does the .ts definition need to be in the root? I'd
> rather
>     > it
>     > > be
>     > > >> in a subfolder (either an existing one like 'www' or a new one)
>     > > >>
>     > > >> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
>     > > >> v-vlkoti@microsoft.com> wrote:
>     > > >>
>     > > >>> Hey, everybody!
>     > > >>>
>     > > >>> I’d like to propose/discuss the idea of redistributing
> Typescript
>     > > >>> definitions along with core plugins, so that users who write
> their
>     > apps
>     > > >> in
>     > > >>> Typescript would get the typings in their projects without
> additional
>     > > >> mess
>     > > >>> with 'tsd'/'typings' (these all are the package managers for
>     > typescript
>     > > >>> declarations) or manual installation from '@types' NPM org.
>     > > >>>
>     > > >>> As mentioned above, our main goal - to reduce the number of
>     > additional
>     > > >>> actions needed to either add the plugin to Typescript project
> or get
>     > > the
>     > > >>> types information and intellisense for JavaScript projects.
> Also,
>     > this
>     > > >>> would reduce the number of network calls to other services
> (typings
>     > > >>> registry, NPM registry) which are known as common points of
> denial
>     > (per
>     > > >>> telemetry data).
>     > > >>>
>     > > >>> The changes are pretty minimal and include adding a d.ts file
> with
>     > type
>     > > >>> definitions (taken from DefinitelyTyped[1]) and 'types' entry
> to
>     > > >>> package.json according to Typescript convention [2]. The sample
>     > > >>> implementation for camera plugin is here:
> https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fgithub.com%2Fapache%2F&data=02%7C01%7Cv-
> vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%
> 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=
> AIkoLA7FNpc9ZYHmWt5kDcX0OgSY%2FgcRp4GJziC3Pno%3D&reserved=0
>     > > >>> cordova-plugin-camera/compare/master...vladimir-kotikov:add-
> typings
>     > > >>>
>     > > >>> Does anyone have any considerations/objections about this
> proposal?
>     > > >>>
>     > > >>> -
>     > > >>> [1] https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fgithub.com%2FDefinitelyTyped%2FDefinitelyTyped%2Fblob%
> 2Fmaster%2F&data=02%7C01%7Cv-vlkoti%40microsoft.com%
> 7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011
> db47%7C1%7C0%7C636196105543207234&sdata=MyYfRRBvGglmjg%
> 2B6eJNW6jJkwk2BiFBQMjw4LOfo%2FMI%3D&reserved=0
>     > > >>> cordova-plugin-camera/index.d.ts
>     > > >>> [2] https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fwww.typescriptlang.org%2Fdocs%2Fhandbook%2Fdeclaration-&
> data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fc
> bd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%
> 7C636196105543207234&sdata=CPBUnwWU%2FTzKyYz5XOeZl4LMIbTAOel3bOGfa
> ZAdQZg%3D&reserved=0
>     > > >>> files/publishing.html
>     > > >>>
>     > > >>> -
>     > > >>> Best regards, Vladimir
>     > > >>>
>     > > >>>
>     > > >>>
>     > > >>> -
>     > > >>> Best regards, Vladimir
>     > > >>>
>     > > >>>
>     > > >>>
>     > > >>
>     > >
>     > >
>     >
>     >
>     > --
>     >
>     > *Frederico Galvão*
>     >
>     > Diretor de Tecnologia
>     >
>     > PontoGet Inovação Web
>     >
>     >
>     > ( +55(62) 8131-5720
>     >
>     > * https://na01.safelinks.protection.outlook.com/?url=
> www.pontoget.com.br&data=02%7C01%7Cv-vlkoti%40microsoft.com%
> 7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011
> db47%7C1%7C0%7C636196105543207234&sdata=IM8yAUf4kSDOesRor8F5eMbAu5f%
> 2FumyE0D2NtuJ8aUk%3D&reserved=0 <https://na01.safelinks.
> protection.outlook.com/?url=http%3A%2F%2Fwww.pontoget.com%
> 2F&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fc
> bd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%
> 7C636196105543207234&sdata=WBnI9Igg2XOizQhXSvlt%
> 2BP1Xqw1xIw8YyvtM%2BNNm31U%3D&reserved=0>
>     >
>
>
>
>


-- 

*Frederico Galvão*

Diretor de Tecnologia

PontoGet Inovação Web


( +55(62) 8131-5720

* www.pontoget.com.br <http://www.pontoget.com/>

Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Котиков Владимир <ko...@gmail.com>.
Hey guys!

I’m excited to see such positive feedback ☺ This sounds like a consensus, so we’re going to publish the PRs to the core plugins in a couple of days.

Also, a bit of technical details: 
  - as Mike mentioned, typescript definitions are not necessarily need to be placed at the root of package – the package just need to have “types” entry in package.json, pointing to the typings location – so the proposed approach is to have “types”/”typings” directory at the root with “index.d.ts” file in it
  - the typings in core plugins will coexist with the ones from DefinitelyTyped repository – this shouldn’t be a big deal from maintenance perspective as the plugin APIs are already stable and I suspect they won’t be changing often. We just need to make sure that if anyone changes the public API of the plugin, he/she will need to update DefinitelyTyped as well as typings in the plugin.

-
Best regards, Vladimir


On 1/10/17, 05:02, "Steven Gill" <st...@gmail.com> wrote:

    DO ITTT
    
    On Mon, Jan 9, 2017 at 5:04 PM, Frederico Galvão <
    frederico.galvao@pontoget.com.br> wrote:
    
    > Please do!
    >
    > 2017-01-09 20:40 GMT-02:00 Mike Hartington <mi...@gmail.com>:
    >
    > > Types can be in sub-folder.
    > > As long as the type entried just points to the path
    > >
    > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.typescriptlang.org%2Fdocs%2Fhandbook%2Fdeclaration-&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=hqPuvVmtxIujvkxHMBKOLjcUkblK1SASy68AtA9Nr7k%3D&reserved=0
    > > files/publishing.html <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.typescriptlang&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=fPB1Zkl2t7GquW0Fbtd9qu2y0oKh%2BpO9i1EkdNYyPqI%3D&reserved=0.
    > > org/docs/handbook/declaration-files/publishing.html>
    > >
    > >
    > > Mike Hartington
    > >
    > >
    > >
    > > > On Jan 9, 2017, at 5:38 PM, Victor Sosa <so...@gmail.com>
    > wrote:
    > > >
    > > > +1... I love this idea! Will help a lot to static analysis tools and
    > > IDEs.
    > > >
    > > > On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com> wrote:
    > > >
    > > >> Thanks for bringing this up Vladimir,
    > > >> +1 -- but does the .ts definition need to be in the root? I'd rather
    > it
    > > be
    > > >> in a subfolder (either an existing one like 'www' or a new one)
    > > >>
    > > >> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
    > > >> v-vlkoti@microsoft.com> wrote:
    > > >>
    > > >>> Hey, everybody!
    > > >>>
    > > >>> I’d like to propose/discuss the idea of redistributing Typescript
    > > >>> definitions along with core plugins, so that users who write their
    > apps
    > > >> in
    > > >>> Typescript would get the typings in their projects without additional
    > > >> mess
    > > >>> with 'tsd'/'typings' (these all are the package managers for
    > typescript
    > > >>> declarations) or manual installation from '@types' NPM org.
    > > >>>
    > > >>> As mentioned above, our main goal - to reduce the number of
    > additional
    > > >>> actions needed to either add the plugin to Typescript project or get
    > > the
    > > >>> types information and intellisense for JavaScript projects. Also,
    > this
    > > >>> would reduce the number of network calls to other services (typings
    > > >>> registry, NPM registry) which are known as common points of denial
    > (per
    > > >>> telemetry data).
    > > >>>
    > > >>> The changes are pretty minimal and include adding a d.ts file with
    > type
    > > >>> definitions (taken from DefinitelyTyped[1]) and 'types' entry to
    > > >>> package.json according to Typescript convention [2]. The sample
    > > >>> implementation for camera plugin is here: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2F&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=AIkoLA7FNpc9ZYHmWt5kDcX0OgSY%2FgcRp4GJziC3Pno%3D&reserved=0
    > > >>> cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
    > > >>>
    > > >>> Does anyone have any considerations/objections about this proposal?
    > > >>>
    > > >>> -
    > > >>> [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDefinitelyTyped%2FDefinitelyTyped%2Fblob%2Fmaster%2F&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=MyYfRRBvGglmjg%2B6eJNW6jJkwk2BiFBQMjw4LOfo%2FMI%3D&reserved=0
    > > >>> cordova-plugin-camera/index.d.ts
    > > >>> [2] https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.typescriptlang.org%2Fdocs%2Fhandbook%2Fdeclaration-&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=CPBUnwWU%2FTzKyYz5XOeZl4LMIbTAOel3bOGfaZAdQZg%3D&reserved=0
    > > >>> files/publishing.html
    > > >>>
    > > >>> -
    > > >>> Best regards, Vladimir
    > > >>>
    > > >>>
    > > >>>
    > > >>> -
    > > >>> Best regards, Vladimir
    > > >>>
    > > >>>
    > > >>>
    > > >>
    > >
    > >
    >
    >
    > --
    >
    > *Frederico Galvão*
    >
    > Diretor de Tecnologia
    >
    > PontoGet Inovação Web
    >
    >
    > ( +55(62) 8131-5720
    >
    > * https://na01.safelinks.protection.outlook.com/?url=www.pontoget.com.br&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=IM8yAUf4kSDOesRor8F5eMbAu5f%2FumyE0D2NtuJ8aUk%3D&reserved=0 <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pontoget.com%2F&data=02%7C01%7Cv-vlkoti%40microsoft.com%7C7f41d67cc4be48efc86308d438fcbd92%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636196105543207234&sdata=WBnI9Igg2XOizQhXSvlt%2BP1Xqw1xIw8YyvtM%2BNNm31U%3D&reserved=0>
    >
    



Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Steven Gill <st...@gmail.com>.
DO ITTT

On Mon, Jan 9, 2017 at 5:04 PM, Frederico Galvão <
frederico.galvao@pontoget.com.br> wrote:

> Please do!
>
> 2017-01-09 20:40 GMT-02:00 Mike Hartington <mi...@gmail.com>:
>
> > Types can be in sub-folder.
> > As long as the type entried just points to the path
> >
> > https://www.typescriptlang.org/docs/handbook/declaration-
> > files/publishing.html <https://www.typescriptlang.
> > org/docs/handbook/declaration-files/publishing.html>
> >
> >
> > Mike Hartington
> >
> >
> >
> > > On Jan 9, 2017, at 5:38 PM, Victor Sosa <so...@gmail.com>
> wrote:
> > >
> > > +1... I love this idea! Will help a lot to static analysis tools and
> > IDEs.
> > >
> > > On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com> wrote:
> > >
> > >> Thanks for bringing this up Vladimir,
> > >> +1 -- but does the .ts definition need to be in the root? I'd rather
> it
> > be
> > >> in a subfolder (either an existing one like 'www' or a new one)
> > >>
> > >> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
> > >> v-vlkoti@microsoft.com> wrote:
> > >>
> > >>> Hey, everybody!
> > >>>
> > >>> I’d like to propose/discuss the idea of redistributing Typescript
> > >>> definitions along with core plugins, so that users who write their
> apps
> > >> in
> > >>> Typescript would get the typings in their projects without additional
> > >> mess
> > >>> with 'tsd'/'typings' (these all are the package managers for
> typescript
> > >>> declarations) or manual installation from '@types' NPM org.
> > >>>
> > >>> As mentioned above, our main goal - to reduce the number of
> additional
> > >>> actions needed to either add the plugin to Typescript project or get
> > the
> > >>> types information and intellisense for JavaScript projects. Also,
> this
> > >>> would reduce the number of network calls to other services (typings
> > >>> registry, NPM registry) which are known as common points of denial
> (per
> > >>> telemetry data).
> > >>>
> > >>> The changes are pretty minimal and include adding a d.ts file with
> type
> > >>> definitions (taken from DefinitelyTyped[1]) and 'types' entry to
> > >>> package.json according to Typescript convention [2]. The sample
> > >>> implementation for camera plugin is here: https://github.com/apache/
> > >>> cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
> > >>>
> > >>> Does anyone have any considerations/objections about this proposal?
> > >>>
> > >>> -
> > >>> [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/
> > >>> cordova-plugin-camera/index.d.ts
> > >>> [2] http://www.typescriptlang.org/docs/handbook/declaration-
> > >>> files/publishing.html
> > >>>
> > >>> -
> > >>> Best regards, Vladimir
> > >>>
> > >>>
> > >>>
> > >>> -
> > >>> Best regards, Vladimir
> > >>>
> > >>>
> > >>>
> > >>
> >
> >
>
>
> --
>
> *Frederico Galvão*
>
> Diretor de Tecnologia
>
> PontoGet Inovação Web
>
>
> ( +55(62) 8131-5720
>
> * www.pontoget.com.br <http://www.pontoget.com/>
>

Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Frederico Galvão <fr...@pontoget.com.br>.
Please do!

2017-01-09 20:40 GMT-02:00 Mike Hartington <mi...@gmail.com>:

> Types can be in sub-folder.
> As long as the type entried just points to the path
>
> https://www.typescriptlang.org/docs/handbook/declaration-
> files/publishing.html <https://www.typescriptlang.
> org/docs/handbook/declaration-files/publishing.html>
>
>
> Mike Hartington
>
>
>
> > On Jan 9, 2017, at 5:38 PM, Victor Sosa <so...@gmail.com> wrote:
> >
> > +1... I love this idea! Will help a lot to static analysis tools and
> IDEs.
> >
> > On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com> wrote:
> >
> >> Thanks for bringing this up Vladimir,
> >> +1 -- but does the .ts definition need to be in the root? I'd rather it
> be
> >> in a subfolder (either an existing one like 'www' or a new one)
> >>
> >> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
> >> v-vlkoti@microsoft.com> wrote:
> >>
> >>> Hey, everybody!
> >>>
> >>> I’d like to propose/discuss the idea of redistributing Typescript
> >>> definitions along with core plugins, so that users who write their apps
> >> in
> >>> Typescript would get the typings in their projects without additional
> >> mess
> >>> with 'tsd'/'typings' (these all are the package managers for typescript
> >>> declarations) or manual installation from '@types' NPM org.
> >>>
> >>> As mentioned above, our main goal - to reduce the number of additional
> >>> actions needed to either add the plugin to Typescript project or get
> the
> >>> types information and intellisense for JavaScript projects. Also, this
> >>> would reduce the number of network calls to other services (typings
> >>> registry, NPM registry) which are known as common points of denial (per
> >>> telemetry data).
> >>>
> >>> The changes are pretty minimal and include adding a d.ts file with type
> >>> definitions (taken from DefinitelyTyped[1]) and 'types' entry to
> >>> package.json according to Typescript convention [2]. The sample
> >>> implementation for camera plugin is here: https://github.com/apache/
> >>> cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
> >>>
> >>> Does anyone have any considerations/objections about this proposal?
> >>>
> >>> -
> >>> [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/
> >>> cordova-plugin-camera/index.d.ts
> >>> [2] http://www.typescriptlang.org/docs/handbook/declaration-
> >>> files/publishing.html
> >>>
> >>> -
> >>> Best regards, Vladimir
> >>>
> >>>
> >>>
> >>> -
> >>> Best regards, Vladimir
> >>>
> >>>
> >>>
> >>
>
>


-- 

*Frederico Galvão*

Diretor de Tecnologia

PontoGet Inovação Web


( +55(62) 8131-5720

* www.pontoget.com.br <http://www.pontoget.com/>

Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Mike Hartington <mi...@gmail.com>.
Types can be in sub-folder.
As long as the type entried just points to the path

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html <https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html>


Mike Hartington



> On Jan 9, 2017, at 5:38 PM, Victor Sosa <so...@gmail.com> wrote:
> 
> +1... I love this idea! Will help a lot to static analysis tools and IDEs.
> 
> On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com> wrote:
> 
>> Thanks for bringing this up Vladimir,
>> +1 -- but does the .ts definition need to be in the root? I'd rather it be
>> in a subfolder (either an existing one like 'www' or a new one)
>> 
>> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
>> v-vlkoti@microsoft.com> wrote:
>> 
>>> Hey, everybody!
>>> 
>>> I’d like to propose/discuss the idea of redistributing Typescript
>>> definitions along with core plugins, so that users who write their apps
>> in
>>> Typescript would get the typings in their projects without additional
>> mess
>>> with 'tsd'/'typings' (these all are the package managers for typescript
>>> declarations) or manual installation from '@types' NPM org.
>>> 
>>> As mentioned above, our main goal - to reduce the number of additional
>>> actions needed to either add the plugin to Typescript project or get the
>>> types information and intellisense for JavaScript projects. Also, this
>>> would reduce the number of network calls to other services (typings
>>> registry, NPM registry) which are known as common points of denial (per
>>> telemetry data).
>>> 
>>> The changes are pretty minimal and include adding a d.ts file with type
>>> definitions (taken from DefinitelyTyped[1]) and 'types' entry to
>>> package.json according to Typescript convention [2]. The sample
>>> implementation for camera plugin is here: https://github.com/apache/
>>> cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
>>> 
>>> Does anyone have any considerations/objections about this proposal?
>>> 
>>> -
>>> [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/
>>> cordova-plugin-camera/index.d.ts
>>> [2] http://www.typescriptlang.org/docs/handbook/declaration-
>>> files/publishing.html
>>> 
>>> -
>>> Best regards, Vladimir
>>> 
>>> 
>>> 
>>> -
>>> Best regards, Vladimir
>>> 
>>> 
>>> 
>> 


Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Victor Sosa <so...@gmail.com>.
+1... I love this idea! Will help a lot to static analysis tools and IDEs.

On Mon, Jan 9, 2017 at 3:56 PM Shazron <sh...@gmail.com> wrote:

> Thanks for bringing this up Vladimir,
> +1 -- but does the .ts definition need to be in the root? I'd rather it be
> in a subfolder (either an existing one like 'www' or a new one)
>
> On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
> v-vlkoti@microsoft.com> wrote:
>
> > Hey, everybody!
> >
> > I’d like to propose/discuss the idea of redistributing Typescript
> > definitions along with core plugins, so that users who write their apps
> in
> > Typescript would get the typings in their projects without additional
> mess
> > with 'tsd'/'typings' (these all are the package managers for typescript
> > declarations) or manual installation from '@types' NPM org.
> >
> > As mentioned above, our main goal - to reduce the number of additional
> > actions needed to either add the plugin to Typescript project or get the
> > types information and intellisense for JavaScript projects. Also, this
> > would reduce the number of network calls to other services (typings
> > registry, NPM registry) which are known as common points of denial (per
> > telemetry data).
> >
> > The changes are pretty minimal and include adding a d.ts file with type
> > definitions (taken from DefinitelyTyped[1]) and 'types' entry to
> > package.json according to Typescript convention [2]. The sample
> > implementation for camera plugin is here: https://github.com/apache/
> > cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
> >
> > Does anyone have any considerations/objections about this proposal?
> >
> > -
> > [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/
> > cordova-plugin-camera/index.d.ts
> > [2] http://www.typescriptlang.org/docs/handbook/declaration-
> > files/publishing.html
> >
> > -
> > Best regards, Vladimir
> >
> >
> >
> > -
> > Best regards, Vladimir
> >
> >
> >
>

Re: [DISCUSS] Include TypeScript definitions in plugins

Posted by Shazron <sh...@gmail.com>.
Thanks for bringing this up Vladimir,
+1 -- but does the .ts definition need to be in the root? I'd rather it be
in a subfolder (either an existing one like 'www' or a new one)

On Mon, Jan 9, 2017 at 5:23 AM, Vladimir Kotikov (Akvelon) <
v-vlkoti@microsoft.com> wrote:

> Hey, everybody!
>
> I’d like to propose/discuss the idea of redistributing Typescript
> definitions along with core plugins, so that users who write their apps in
> Typescript would get the typings in their projects without additional mess
> with 'tsd'/'typings' (these all are the package managers for typescript
> declarations) or manual installation from '@types' NPM org.
>
> As mentioned above, our main goal - to reduce the number of additional
> actions needed to either add the plugin to Typescript project or get the
> types information and intellisense for JavaScript projects. Also, this
> would reduce the number of network calls to other services (typings
> registry, NPM registry) which are known as common points of denial (per
> telemetry data).
>
> The changes are pretty minimal and include adding a d.ts file with type
> definitions (taken from DefinitelyTyped[1]) and 'types' entry to
> package.json according to Typescript convention [2]. The sample
> implementation for camera plugin is here: https://github.com/apache/
> cordova-plugin-camera/compare/master...vladimir-kotikov:add-typings
>
> Does anyone have any considerations/objections about this proposal?
>
> -
> [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/
> cordova-plugin-camera/index.d.ts
> [2] http://www.typescriptlang.org/docs/handbook/declaration-
> files/publishing.html
>
> -
> Best regards, Vladimir
>
>
>
> -
> Best regards, Vladimir
>
>
>