@agrozyme/types-tronweb
v5.3.2
Published
TypeScript definitions for tronweb
Downloads
47,170
Readme
types-tronweb
TypeScript definitions for TronWeb
- Include all TronWeb and TronLink types from source code
- convert protobuf definitions to typescript definitions and re-export types with prefix
Tron
- TronLink types with prefix
TronLink
- only the TronWeb class can use
new TronWeb
byimport TronWeb from 'tronweb'
- other declare class always use for type hint
- use this package, to create folder
@types/tronweb
under the source folder and put the code inindex.d.ts
declare module 'tronweb' {
export * from '@agrozyme/types-tronweb';
import TronWeb from '@agrozyme/types-tronweb';
export default TronWeb;
}
- In browser project, it can manually define the
TronLink
injected object type
declare global {
interface Window {
tron?: Tron;
tronLink?: TronLink;
tronWeb?: TronWeb;
}
}