|
| 1 | +/** |
| 2 | + * Copyright 2022 Google LLC. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +import { MVCObject } from "../../maps/event/mvcobject"; |
| 18 | + |
| 19 | +export class DataPolygon extends MVCObject implements google.maps.Data.Polygon { |
| 20 | + constructor( |
| 21 | + elements?: |
| 22 | + | google.maps.MVCArray<google.maps.MVCArray<google.maps.LatLng>> |
| 23 | + | google.maps.MVCArray<google.maps.LatLng> |
| 24 | + | google.maps.LatLng[][] |
| 25 | + | google.maps.LatLngLiteral[][] |
| 26 | + | google.maps.LatLng[] |
| 27 | + | google.maps.LatLngLiteral[] |
| 28 | + ) { |
| 29 | + super(); |
| 30 | + } |
| 31 | + public forEachLatLng = jest |
| 32 | + .fn() |
| 33 | + .mockImplementation((callback: (a: google.maps.LatLng) => void): void => { |
| 34 | + return null; |
| 35 | + }); |
| 36 | + public getArray = jest |
| 37 | + .fn() |
| 38 | + .mockImplementation( |
| 39 | + (): google.maps.MVCArray<google.maps.LatLng>[] => |
| 40 | + [] as google.maps.MVCArray<google.maps.LatLng>[] |
| 41 | + ); |
| 42 | + public getAt = jest |
| 43 | + .fn() |
| 44 | + .mockImplementation( |
| 45 | + (): google.maps.MVCArray<google.maps.LatLng> | null => null |
| 46 | + ); |
| 47 | + public getLength = jest.fn().mockImplementation((): number => 0); |
| 48 | + public getType = jest.fn().mockImplementation((): string => "MultiPolygon"); |
| 49 | +} |
0 commit comments