iziToast icon indicating copy to clipboard operation
iziToast copied to clipboard

Where is @types/izitoast ?

Open HamedFathi opened this issue 8 years ago • 8 comments

Hi

When I want to use your library with typescript, I have an error

Try `npm install @types/izitoast`

How can I use it in Typescript ? and define the .d.ts file ?

Can you add it in @types ?

I think it is better you add

declare var iziToast: IziToast;
declare var iziToastSettings: IziToastSettings;

declare module "iziToast" {
	export = {iziToast,iziToastSettings};
}

in end of .d.ts file for importing it with

import * as izitoast from 'iziToast';

thanks

HamedFathi avatar Sep 17 '17 14:09 HamedFathi

Hello @HamedFathi. Can you tell me what would be the right structure to run TS? Can you make a PR with this modification?

marcelodolza avatar Sep 20 '17 02:09 marcelodolza

Hello @dolce

I am not sure what should I do ?! I checked toastr.d.ts and added the code below in your current izitoast.d.ts

declare module "iziToast" {
	export = iziToast;
}

izi

and it works in typescript with this way import * as izi from 'iziToast'; but I need more I want to use it in this way

import { IziToast, IziToastSettings } from 'iziToast';

I need the access to both interfaces specially IziToastSettings but in first way I can use IziToast functionality only.

izi

HamedFathi avatar Sep 20 '17 06:09 HamedFathi

Hello! Unfortunately I do not work with TS and I do not have much time available. I need someone who knows this structure to implement this pattern.

@incetarik who made the last PR referring to TypeScript. Tarık, could you help us?

marcelodolza avatar Sep 20 '17 18:09 marcelodolza

@dolce

I pulled request for this problem based on Toastr .

If you confirm it I will create @types/izitoast for working better with Typescript compiler. You can see all information about @types in DefinitelyTyped and Npm Types

HamedFathi avatar Sep 20 '17 18:09 HamedFathi

I will interest with this and try to move to the @types area.

incetarik avatar Oct 02 '17 13:10 incetarik

@incetarik

Can you move my pull request to @types ? it have export module and works perfectly.

HamedFathi avatar Oct 02 '17 14:10 HamedFathi

Ok. I will interest when I'm available.

incetarik avatar Oct 02 '17 14:10 incetarik

Updated. @incetarik @HamedFathi .

marcelodolza avatar Oct 06 '17 21:10 marcelodolza