Open rukundo-kevin opened 1 year ago
Wanted to say the same thing.
I am trying to use it in the Typescript App, but it lacks it. In the meantime, can you suggest another way to get Districts in Rwanda with Typescript? Or another package.
Thank you!
Wanted to say the same thing.
I am trying to use it in the Typescript App, but it lacks it. In the meantime, can you suggest another way to get Districts in Rwanda with Typescript? Or another package.
Thank you!
I don't know another package with TS support but you can use these type definitions in your project.
declare module "rwanda" {
export function Provinces(): string[];
export function Districts(province?: string): string[] | undefined;
export function Sectors(
province?: string,
district?: string
): string[] | undefined;
export function Cells(
province?: string,
district?: string,
sector?: string
): string[] | undefined;
export function Villages(
province?: string,
district?: string,
sector?: string,
cell?: string
): string[] | undefined;
}
Put them inside a file named rwanda.d.ts
in your src or types directory
@rukundo-kevin Go ahead, PRs are welcome
Wanted to say the same thing. I am trying to use it in the Typescript App, but it lacks it. In the meantime, can you suggest another way to get Districts in Rwanda with Typescript? Or another package. Thank you!
I don't know another package with TS support but you can use these type definitions in your project.
declare module "rwanda" { export function Provinces(): string[]; export function Districts(province?: string): string[] | undefined; export function Sectors( province?: string, district?: string ): string[] | undefined; export function Cells( province?: string, district?: string, sector?: string ): string[] | undefined; export function Villages( province?: string, district?: string, sector?: string, cell?: string ): string[] | undefined; }
Put them inside a file named
rwanda.d.ts
in your src or types directory
Thank you @rukundo-kevin
It is working well now!
Hello,
The project currently lacks type definitions, and I'm willing to take on the task of creating them