Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions types/gorilla-engine/components/MappingEditor.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
declare namespace GorillaEngine.UI {
interface Zone {
path: string;
name: string;
index: number;
rootKey: number;
lowKey: number;
highKey: number;
lowVel: number;
highVel: number;
samplePath: string;
}
interface MappingEditorProps extends Common, Bounds, Background {
parentPath: string;
zones?: Zone[];
refreshView(index?: number): void;
addZone(zone: Partial<Zone>): Zone;
Expand Down
2 changes: 1 addition & 1 deletion types/gorilla-engine/gorilla-engine-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const label = new GorillaEngine.UI.Label({ margin: 5 });

const slider = new GorillaEngine.UI.Slider({ id: "slider", x: 0 });

const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "myMapping" });
const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "myMappingEditor" });
3 changes: 2 additions & 1 deletion types/pxr-oneline/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ declare namespace OneLine {
adUnitRequest(arrFoAdIds?: string[], allowReload?: boolean): void;
preBidAdUnit(prebidBids: PrebidBids, gtag: string, isDebug: boolean): any;
requestVideoPlayerAds(onBiddingComplete: () => void): void;
showCmp(): void;
loadScript(src: string, priority: "async" | "defer" | "instant" | "async"): void;
buildVideoUrl(
bidder: BidderConfig[],
placementID: string,
Expand Down Expand Up @@ -72,6 +74,5 @@ declare namespace OneLine {
type NoParamFunction = () => void;
type ParamFunction = (arg: any) => void;
}

declare const OneLine: OneLine.OneLine;
export = OneLine;
14 changes: 14 additions & 0 deletions types/pxr-oneline/oneline-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ const ndOne: OneLine.OneLine = {
// This is a mock implementation and should be replaced with your actual logic
return `https://example.com/video?placement=${placementID}&bidder=${bidder.map(b => b.bidder).join(",")}`;
},
showCmp: () => {
// Mock implementation for showCmp
console.log("Showing CMP screen...");
const currentDomain = window.location.origin;
if (currentDomain) {
console.log(`Redirecting to: ${currentDomain}/#cmpscreen`);
} else {
console.warn("NDM: Unable to show CMP");
}
},
loadScript: (src: string, priority: "async" | "defer" | "instant" | "async"): void => {
// Mock implementation for loadScript
console.log(`Loading script from: ${src} with priority: ${priority}`);
},
};

// Test cases
Expand Down
12 changes: 10 additions & 2 deletions types/pxr-oneline/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/pxr-oneline",
"version": "1.5.9999",
"version": "1.6.9999",
"nonNpm": true,
"nonNpmDescription": "The OneLine handles all the logic needed for a publisher to serve ads.",
"projects": [
Expand All @@ -12,8 +12,16 @@
},
"owners": [
{
"name": "PXR Advertising",
"name": "Diogo",
"githubUsername": "diogopxrnextday"
},
{
"name": "Edwin",
"githubUsername": "edwinveldhuizen"
},
{
"name": "Bart",
"githubUsername": "bart-digitalenterprises"
}
]
}
12 changes: 10 additions & 2 deletions types/xrm/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2923,7 +2923,7 @@ declare namespace Xrm {
* Interface an OptionSet attribute.
* @see {@link EnumAttribute}
*/
interface MultiSelectOptionSetAttribute extends EnumAttribute<number[]> {
interface MultiSelectOptionSetAttribute<T extends number = number> extends EnumAttribute<T[]> {
/**
* Gets the attribute format.
* @returns The format of the attribute.
Expand Down Expand Up @@ -6083,7 +6083,7 @@ declare namespace Xrm {
* @returns On success, returns a promise object containing the attributes specified earlier in the description of the successCallback parameter.
* @see {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-webapi/updaterecord External Link: updateRecord (Client API reference)}
*/
updateRecord(entityLogicalName: string, id: string, data: any): Async.PromiseLike<any>;
updateRecord(entityLogicalName: string, id: string, data: any): Async.PromiseLike<UpdateResponse>;
}

/**
Expand All @@ -6094,6 +6094,14 @@ declare namespace Xrm {
id: string;
}

/**
* Interface for the WebAPI UpdateRecord request response
*/
interface UpdateResponse {
entityType: string;
id: string;
}

/**
* Interface for the Promise error response arguments
*/
Expand Down
49 changes: 47 additions & 2 deletions types/xrm/xrm-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ alert(`The current form type is: ${formContext.ui.getFormType()}`);

alert(`The current entity type is: ${formContext.data.entity.getEntityName()}`);

/// Demonstrate Optionset Value as int in Turbo Forms
/// Demonstrate OptionSet Value as int

const optionSetAttribute = formContext.getAttribute<Xrm.Attributes.OptionSetAttribute>("statuscode");
if (optionSetAttribute !== null) {
Expand All @@ -170,6 +170,41 @@ if (optionSetAttribute !== null) {
}
}

/// Demonstrate OptionSet Value as enum

enum TestOptionSet {
Option1 = 56666000,
Option2 = 56666001,
}

const optionSetAttributeEnum = formContext.getAttribute<Xrm.Attributes.OptionSetAttribute<TestOptionSet>>("statuscode");
if (optionSetAttributeEnum !== null) {
const optionEnumValue: TestOptionSet | null = optionSetAttributeEnum.getValue();
}

/// Demonstrate MultiSelectOptionSet Value as int

const multiSelectOptionSetAttribute = formContext.getAttribute<Xrm.Attributes.MultiSelectOptionSetAttribute>(
"statuscode",
);
if (multiSelectOptionSetAttribute !== null) {
const multiSelectOptionValue: number = multiSelectOptionSetAttribute.getOptions()[0].value;
}

/// Demonstrate MultiSelectOptionSet Value as enum

enum TestMultiSelectOptionSet {
Option1 = 56666000,
Option2 = 56666001,
}

const multiSelectOptionSetAttributeEnum = formContext.getAttribute<
Xrm.Attributes.MultiSelectOptionSetAttribute<TestMultiSelectOptionSet>
>("statuscode");
if (multiSelectOptionSetAttributeEnum !== null) {
const multiSelectOptionEnumValue: TestMultiSelectOptionSet[] | null = multiSelectOptionSetAttributeEnum.getValue();
}

/// Demonstrate setFormNotification

let level: Xrm.FormNotificationLevel;
Expand Down Expand Up @@ -220,6 +255,16 @@ Xrm.Utility.getEntityMetadata("account", ["telephone1"]).then((metadata) => {
console.log(metadata.Attributes["statuscode"].OptionSet[0].Label.LocalizedLabels[0].Label);
});

// Demonstrate WebAPI CreateRecord
Xrm.WebApi.createRecord("contact", { fullname: "Neo" }).then((response) => {
console.log(response.entityType, response.id);
});

// Demonstrate WebAPI UpdateRecord
Xrm.WebApi.updateRecord("contact", "1d-123", { fullname: "Neo" }).then((response) => {
console.log(response.entityType, response.id);
});

// Demonstrate WebAPI RetrieveMultiple
Xrm.WebApi.retrieveMultipleRecords(
"contact",
Expand Down Expand Up @@ -634,7 +679,7 @@ const multiSelectOptionSetControl = formContext.getControl<Xrm.Controls.MultiSel
if (multiSelectOptionSetControl === null) {
throw new Error("Control does not exist!");
}
// $ExpectType MultiSelectOptionSetAttribute
// $ExpectType MultiSelectOptionSetAttribute<number>
multiSelectOptionSetControl.getAttribute();

// Demonstrates getWebResourceUrl
Expand Down