This package contains the TypeScript type declaration (.d.ts
) files for the WebNN API
TODO: Add installations instructions once npm package has been created.
Since this package is outside of DefinitelyTyped, the types won't be automatically picked up. The following is a list of ways to add it to type lookup.
TODO: Add instructions for configuring
tsconfig.json
, Webpack, etc.
- Update WebNN specification under
spec
- Generate types with
npm run generate
- Manually update
webnn/index.d.ts
with changes fromgenerate/index.d.ts
. Note that there are intentional differences between the versions undergenerate/
andwebnn/
(see next section). - Push changes to all files under
generated/
andwebnn/
.
- The current version of the TypeScript types generator doesn't add return types for
new ()
on interfaces.- Currently only
MLGraphBuilder
needs to be updatednew (context: MLContext) : MLGraphBuilder;
- Currently only
- The
npu
device type has been added toMLDeviceType
for performance and compliance testing. - The experimental
MLBuffer
API has been added for exploration.