Skip to content

Commit

Permalink
Saving this, because the idl works
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Jan 31, 2025
1 parent d86d318 commit c474ae4
Showing 1 changed file with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Microsoft.CmdPal.Extensions
{
[contractversion(1)]
[contractversion(2)]
apicontract ExtensionsContract {}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
Expand All @@ -22,7 +22,7 @@ namespace Microsoft.CmdPal.Extensions
String Icon { get; };
Windows.Storage.Streams.IRandomAccessStreamReference Data { get; };
};

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
runtimeclass IconInfo {
IconInfo(String iconString);
Expand Down Expand Up @@ -78,7 +78,7 @@ namespace Microsoft.CmdPal.Extensions
Dismiss, // Reset the palette to the main page and dismiss
GoHome, // Go back to the main page, but keep it open
GoBack, // Go back one level
Hide, // Keep this page open, but hide the palette.
Hide, // Keep this page open, but hide the palette.
KeepOpen, // Do nothing.
GoToPage, // Go to another page. GoToPageArgs will tell you where.
};
Expand Down Expand Up @@ -110,6 +110,11 @@ namespace Microsoft.CmdPal.Extensions
interface IInvokableCommand requires ICommand {
ICommandResult Invoke();
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 2)]
interface IInvokableCommand2 requires IInvokableCommand {
ICommandResult Invoke(Object sender);
}

[uuid("ef5db50c-d26b-4aee-9343-9f98739ab411")]
[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
Expand Down Expand Up @@ -231,7 +236,7 @@ namespace Microsoft.CmdPal.Extensions
interface IPage requires ICommand {
String Title { get; };
Boolean IsLoading { get; };

OptionalColor AccentColor { get; };
}

Expand All @@ -246,7 +251,7 @@ namespace Microsoft.CmdPal.Extensions
IconInfo Icon{ get; };
String Title{ get; };
String Subtitle{ get; };
}
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface ICommandContextItem requires ICommandItem, IContextItem {
Expand All @@ -273,7 +278,7 @@ namespace Microsoft.CmdPal.Extensions

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface IListPage requires IPage, INotifyItemsChanged {
// DevPal will be responsible for filtering the list of items, unless the
// DevPal will be responsible for filtering the list of items, unless the
// class implements IDynamicListPage
String SearchText { get; };
String PlaceholderText { get; };
Expand All @@ -283,7 +288,7 @@ namespace Microsoft.CmdPal.Extensions
Boolean HasMoreItems { get; };
ICommandItem EmptyContent { get; };

IListItem[] GetItems();
IListItem[] GetItems();
void LoadMore();
}

Expand Down Expand Up @@ -312,6 +317,37 @@ namespace Microsoft.CmdPal.Extensions
IForm[] Forms();
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
[uuid("b64def0f-8911-4afa-8f8f-042bd778d088")]
interface IContent requires INotifyPropChanged {
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface IFormContent requires IContent {
String TemplateJson { get; };
String DataJson { get; };
String StateJson { get; };
ICommandResult SubmitForm(String payload);
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface IMarkdownContent requires IPage {
String Body { get; };
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface ITreeContent requires IPage, INotifyItemsChanged {
IContent RootContent { get; };
IContent[] GetContent();
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface IContentPage requires IPage, INotifyItemsChanged {
IContent[] GetContent();
IDetails Details { get; };
IContextItem[] Commands { get; };
}

[contract(Microsoft.CmdPal.Extensions.ExtensionsContract, 1)]
interface ICommandSettings {
IFormPage SettingsPage { get; };
Expand Down

0 comments on commit c474ae4

Please sign in to comment.