Open trinhvietnam opened 7 years ago
i definitely agree. also when using plain javascript you can benefit from that with editor like vscode. so :+1: by me!
+1
@jcbarton I remember you had developed some sort of decorator package for TypeScript to use with express-cassandra loadSchema. Do you have any thoughts regarding this?
@masumsoft if you're interested I'm re-writing the express-cassandra to TypeScript That'll help with TypeScript definition and future plugin of plugin with lerna
@rennanboni is it possible to wrap express-cassandra to additionally provide typescript types support, so it can easily get future updates? I've never used typescript, so it won't be very comfortable for me to maintain it if re-written from scratch.
Hi @masumsoft, sorry for the delay,
Actually it is possible, and I was using similar idea long time ago, still a working in progress as you can see there is few methods declared Using this declaration on typeping.d.ts the IDEA can help with autocomplete
declare module 'express-cassandra' {
export function uuid(): string;
export let instance: ExpressCassandraInstance;
export class ExpressCassandraInstance {
[key: string]: ExpressCassandraSearch;
}
export interface ExpressCassandraSearch {
find(query: any, options: ExpressCassandraSearchOptions, callback: (err, result: any) => void);
findOne(query: any, options: ExpressCassandraSearchOptions, callback: (err, result: any) => void);
eachRow(query: any, options: ExpressCassandraSearchOptions, eachRow: (n, row: any) => void, callback: (err, result: ExpressCassandraPageModel) => void);
}
export class ExpressCassandraSearchOptions {
materialized_view?: string;
fetchSize?: number;
raw?: boolean;
pageState?: string;
select?: string[];
}
export class ExpressCassandraPageModel {
pageState: string;
}
}
Hi @masumsoft, sorry for the delay,
Actually it is possible, and I was using similar idea long time ago, still a working in progress as you can see there is few methods declared Using this declaration on typeping.d.ts the IDEA can help with autocomplete
declare module 'express-cassandra' { export function uuid(): string; export let instance: ExpressCassandraInstance; export class ExpressCassandraInstance { [key: string]: ExpressCassandraSearch; } export interface ExpressCassandraSearch { find(query: any, options: ExpressCassandraSearchOptions, callback: (err, result: any) => void); findOne(query: any, options: ExpressCassandraSearchOptions, callback: (err, result: any) => void); eachRow(query: any, options: ExpressCassandraSearchOptions, eachRow: (n, row: any) => void, callback: (err, result: ExpressCassandraPageModel) => void); } export class ExpressCassandraSearchOptions { materialized_view?: string; fetchSize?: number; raw?: boolean; pageState?: string; select?: string[]; } export class ExpressCassandraPageModel { pageState: string; } }
How long will it take to finish it?
Hii this will be a great addition. Any updates on Typescript defined Types?
Hey guys, any updates with this? Typescript support will be so helpful! Thanks!
Any update ? This will be so helpful for ts devs
Any news?
do we have any updates on this?
Issue was opened 5 years ago. Still not a priority. Is it at least opened for PR ?
Is it at least opened for PR ?
@y-nk yes PRs are welcome
Please write Typescript defined Types for this module