You can cast like this:
return this.createMarkerStyle(<MarkerSymbolInfo> symbolInfo);
Or like this if you want to be compatible with tsx mode:
return this.createMarkerStyle(symbolInfo as MarkerSymbolInfo);
Just remember that this is a compile-time cast, and not a runtime cast.
More Related Contents:
- Build a function object with properties in TypeScript
- Any difference between type assertions and the newer `as` operator in TypeScript?
- TypeScript: Index signature is missing in type
- How do you emulate nominal typing in TypeScript?
- How do I convert between numeric types safely and idiomatically?
- TypeScript enum to object array
- Converting a Vec to Vec in-place and with minimal overhead
- How to tweak LISTAGG to support more than 4000 character in select query?
- Angular: Typescript casting JSON response as object model not working
- CASTING attributes for Ordering on a Doctrine2 DQL Query
- What is TypeScript and why would I use it in place of JavaScript? [closed]
- printf(“%p”) and casting to (void *)
- I get “Http failure response for (unknown url): 0 Unknown Error” instead of actual error message in Angular
- The property ‘value’ does not exist on value of type ‘HTMLElement’
- Min / Max Validator in Angular 2 Final
- Types for function that applys name of function and arguments
- Angular2 component’s “this” is undefined when executing callback function
- Explicit type casting example in Java
- Typescript: How can I make entries in an ES6 Map based on an object key/value type
- Angular 2 Form “Cannot find control with path”
- How to cancel/unsubscribe all pending HTTP requests in Angular 4+
- TypeScript error in Angular2 code: Cannot find name ‘module’
- Is this behavior of “𝚊𝚗𝚢” a TypeScript Type System Bug?
- Behaviour subject initial value null?
- Jest won’t transform the module – SyntaxError: Cannot use import statement outside a module
- Mocking dayjs extend
- Explicit/implicit cast operator fails when using LINQ’s .Cast() operator
- Java casting “.class”-operator used on a generic type, e.g. List, to “Class
- Is it Undefined Behaviour to cast away the constness of a function parameter?
- How to import a js library without definition file in typescript file