Skip to content

Commit

Permalink
Merge pull request #185 from yuripourre/typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
limbofeather authored Jan 15, 2024
2 parents 3f85ccd + 4ce779f commit 12c2070
Show file tree
Hide file tree
Showing 7 changed files with 1,410 additions and 1,744 deletions.
4 changes: 4 additions & 0 deletions babylonjs/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default class ZestyBanner {
constructor(adUnit: any, format: any, style: any, height: any, scene: any, webXRExperienceHelper?: any, beacon?: boolean);
zestyBanner: any;
}
10 changes: 10 additions & 0 deletions babylonjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": ["src/**/*"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist",
"declarationMap": true
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.30.0"
"eslint-plugin-react": "^7.30.0",
"typescript": "^5.3.3"
},
"private": true,
"workspaces": [
Expand Down
43 changes: 43 additions & 0 deletions utils/formats.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export namespace formats {
namespace tall {
let width: number;
let height: number;
namespace style {
let standard: string;
let minimal: string;
let transparent: string;
}
}
namespace wide {
let width_1: number;
export { width_1 as width };
let height_1: number;
export { height_1 as height };
export namespace style_1 {
let standard_1: string;
export { standard_1 as standard };
let minimal_1: string;
export { minimal_1 as minimal };
let transparent_1: string;
export { transparent_1 as transparent };
}
export { style_1 as style };
}
namespace square {
let width_2: number;
export { width_2 as width };
let height_2: number;
export { height_2 as height };
export namespace style_2 {
let standard_2: string;
export { standard_2 as standard };
let minimal_2: string;
export { minimal_2 as minimal };
let transparent_2: string;
export { transparent_2 as transparent };
}
export { style_2 as style };
}
}
export const defaultFormat: "square";
export const defaultStyle: "standard";
57 changes: 57 additions & 0 deletions utils/helpers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Parses ipfs:// and ar:// links and IPFS hashes to URLs.
* @param {String} uri The ipfs:// link or IPFS hash.
* @returns A formatted URL to the IPFS resource.
*/
export function parseProtocol(uri: string): string;
/**
* Retrieves an IPFS gateway to alleviate rate-throttling from using only a single gateway.
* Selection is weighted random based on average latency.
* @returns A weighted random public IPFS gateway
*/
export function getIPFSGateway(): string;
/**
* For each of the following browser checking functions, we have a match with a
* confidence of "Full" if both the feature detection check and user agent check
* come back true. If only one of them comes back true, we have a match with a confidence
* of "Partial". If neither are true, match is false and our confidence is "None".
*/
/**
* Performs feature detection and a UA check to determine if user is using Oculus Browser.
* @returns an object indicating whether there is a match and the associated confidence level.
*/
export function checkOculusBrowser(): {
match: boolean;
confidence: string;
};
/**
* Performs feature detection and a UA check to determine if user is using Wolvic.
* @returns an object indicating whether there is a match and the associated confidence level.
*/
export function checkWolvicBrowser(): {
match: boolean;
confidence: string;
};
/**
* Performs feature detection and a UA check to determine if user is using Pico's browser.
* @returns an object indicating whether there is a match and the associated confidence level.
*/
export function checkPicoBrowser(): Promise<{
match: boolean;
confidence: string;
}>;
/**
* Performs feature detection and a UA check to determine if user is using a browser on their desktop.
* @returns an object indicating whether there is a match and the associated confidence level.
*/
export function checkDesktopBrowser(): {
match: boolean;
confidence: string;
};
export function checkUserPlatform(): Promise<{
platform: string;
confidence: string;
}>;
export function openURL(url: any): void;
export function urlContainsUTMParams(url: any): boolean;
export function appendUTMParams(url: any, spaceId: any): string;
9 changes: 9 additions & 0 deletions utils/networking.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function fetchCampaignAd(adUnitId: any, format?: string, style?: string): Promise<any>;
/**
* Increment the on-load event count for the space
* @param {string} spaceId The space ID
* @returns A Promise representing the POST request
*/
export function sendOnLoadMetric(spaceId: string, campaignId?: any): Promise<void>;
export function sendOnClickMetric(spaceId: any, campaignId?: any): Promise<void>;
export function analyticsSession(spaceId: any, campaignId: any): Promise<void>;
Loading

0 comments on commit 12c2070

Please sign in to comment.