(libraryName: string)
| 109 | ): Promise<LibraryMap[TLibraryName]>; |
| 110 | |
| 111 | export async function importLibrary(libraryName: string): Promise<unknown> { |
| 112 | if (!setOptionsWasCalled_) { |
| 113 | logDevWarning(MSG_SET_OPTIONS_NOT_CALLED); |
| 114 | } |
| 115 | |
| 116 | if (!window?.google?.maps?.importLibrary) { |
| 117 | throw new Error("google.maps.importLibrary is not installed."); |
| 118 | } |
| 119 | |
| 120 | return (await google.maps.importLibrary( |
| 121 | libraryName |
| 122 | )) as LibraryMap[keyof LibraryMap]; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * The installImportLibrary_ function makes sure that a usable version of the |
no outgoing calls
no test coverage detected
searching dependent graphs…