Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing options types #49

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/types/type-declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,21 @@ export interface GoogleTagManagerApi {
dataLayer: Record<string, any>[];
google_tag_manager: GoogleTagManager;
}

/* Google Maps Embed */
export interface GoogleMapsEmbedOptions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export interface GoogleMapsEmbedOptions {
export interface GoogleMapsEmbedQueries {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be suffixed with Queries instead of Options as width and height are missing.

GoogleMapsEmbedOptions should probably be something like
type GoogleMapsEmbedOptions = GoogleMapsEmbedQueries & GoogleMapsEmbedAttributes

Copy link
Collaborator Author

@flashdesignory flashdesignory Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see - yeah, makes sense to differentiate between attributes and params... how about:
GoogleMapsEmbedParams ? in that way it matches "attributes" and "params" keys in the json files: https://github.com/GoogleChromeLabs/third-party-capital/blob/main/src/third-parties/google-maps-embed/data.json#L12

key: string;
mode: 'place' | 'view' | 'directions' | 'streetview' | 'search';
q?: string;
center?: string;
zoom?: string;
maptype?: 'roadmap' | 'satellite';
language?: string;
region?: string;
}

/* Youtube Embed */
export interface YoutubeEmbedOptions {
flashdesignory marked this conversation as resolved.
Show resolved Hide resolved
videoid: string;
playlabel?: string;
}
Loading