dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

Add type for schema

Open willsmanley opened this issue 3 years ago • 1 comments

I know this isn't 100% right because it is causing a few dozen typescript errors, but I think it is important to assign & export a type to Entity.schema.

I'm using eslint rules that prohibit unsafe any usage and it seems that the schema property is generally well-defined.

willsmanley avatar Jan 15 '21 12:01 willsmanley

@willsmanley might be fighting a losing battle here as any is used extensively throughout the codebase, I think because it was initially developed in JS, then partially migrated to TS. You might be able to "fix" the schema type but then you just run into a bunch of downstream typing issues that you'll probably never be able to resolve without rewriting most of the codebase!

Curious as to why you need to access the schema property? I wonder if it should even be public.

You do have type inference now which might help?

rbdmorgan avatar Jul 20 '22 15:07 rbdmorgan