Skip to content

Commit

Permalink
Generate API with updated API properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyaulee committed Mar 26, 2021
1 parent 24efd91 commit 3110a0f
Show file tree
Hide file tree
Showing 142 changed files with 5,732 additions and 2,432 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

[
{
"namespace": "contentScripts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

using System;
using System.Collections.Generic;
using System.Text.Json;
Expand All @@ -8,25 +6,25 @@
namespace WebExtension.Net.ContentScripts
{
/// <inheritdoc />
public class ContentScriptsAPI : IContentScriptsAPI
public class ContentScriptsAPI : BaseAPI, IContentScriptsAPI
{
private readonly WebExtensionJSRuntime webExtensionJSRuntime;
/// <summary>Creates a new instance of ContentScriptsAPI.</summary>
/// <param name="webExtensionJSRuntime">Web Extension JS Runtime</param>
public ContentScriptsAPI(WebExtensionJSRuntime webExtensionJSRuntime)
public ContentScriptsAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "contentScripts")
{
this.webExtensionJSRuntime = webExtensionJSRuntime;
}




// Function Definition
/// <summary>
/// Register a content script programmatically
/// </summary>
/// <param name="contentScriptOptions"></param>
public virtual ValueTask Register(RegisteredContentScriptOptions contentScriptOptions)
{
return webExtensionJSRuntime.InvokeVoidAsync("contentScripts.register", contentScriptOptions);
return InvokeVoidAsync("register", contentScriptOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

using System;
using System.Collections.Generic;
using System.Text.Json;
Expand All @@ -13,6 +11,8 @@ namespace WebExtension.Net.ContentScripts
public interface IContentScriptsAPI
{



// Function Definition Interface
/// <summary>
/// Register a content script programmatically
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

using System;
using System.Collections.Generic;
using System.Text.Json;
Expand All @@ -21,7 +19,7 @@ public class RegisteredContentScript : BaseObject
/// </summary>
public virtual ValueTask Unregister()
{
return webExtensionJSRuntime.InvokeVoidAsync("");
return InvokeVoidAsync("unregister");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

using System;
using System.Collections.Generic;
using System.Text.Json;
Expand All @@ -12,71 +10,179 @@ namespace WebExtension.Net.ContentScripts
/// <summary>
/// Details of a content script registered programmatically
/// </summary>
public class RegisteredContentScriptOptions
public class RegisteredContentScriptOptions : BaseObject
{

// Property Definition
private IEnumerable<Manifest.MatchPattern> _matches;
/// <summary>
///
/// </summary>
[JsonPropertyName("matches")]
public IEnumerable<Manifest.MatchPattern> Matches { get; set; }
public IEnumerable<Manifest.MatchPattern> Matches
{
get
{
InitializeProperty("matches", _matches);
return _matches;
}
set
{
_matches = value;
}
}

// Property Definition
private IEnumerable<Manifest.MatchPattern> _excludeMatches;
/// <summary>
///
/// </summary>
[JsonPropertyName("excludeMatches")]
public IEnumerable<Manifest.MatchPattern> ExcludeMatches { get; set; }
public IEnumerable<Manifest.MatchPattern> ExcludeMatches
{
get
{
InitializeProperty("excludeMatches", _excludeMatches);
return _excludeMatches;
}
set
{
_excludeMatches = value;
}
}

// Property Definition
private IEnumerable<string> _includeGlobs;
/// <summary>
///
/// </summary>
[JsonPropertyName("includeGlobs")]
public IEnumerable<string> IncludeGlobs { get; set; }
public IEnumerable<string> IncludeGlobs
{
get
{
InitializeProperty("includeGlobs", _includeGlobs);
return _includeGlobs;
}
set
{
_includeGlobs = value;
}
}

// Property Definition
private IEnumerable<string> _excludeGlobs;
/// <summary>
///
/// </summary>
[JsonPropertyName("excludeGlobs")]
public IEnumerable<string> ExcludeGlobs { get; set; }
public IEnumerable<string> ExcludeGlobs
{
get
{
InitializeProperty("excludeGlobs", _excludeGlobs);
return _excludeGlobs;
}
set
{
_excludeGlobs = value;
}
}

// Property Definition
private IEnumerable<ExtensionTypes.ExtensionFileOrCode> _css;
/// <summary>
/// The list of CSS files to inject
/// </summary>
[JsonPropertyName("css")]
public IEnumerable<ExtensionTypes.ExtensionFileOrCode> Css { get; set; }
public IEnumerable<ExtensionTypes.ExtensionFileOrCode> Css
{
get
{
InitializeProperty("css", _css);
return _css;
}
set
{
_css = value;
}
}

// Property Definition
private IEnumerable<ExtensionTypes.ExtensionFileOrCode> _js;
/// <summary>
/// The list of JS files to inject
/// </summary>
[JsonPropertyName("js")]
public IEnumerable<ExtensionTypes.ExtensionFileOrCode> Js { get; set; }
public IEnumerable<ExtensionTypes.ExtensionFileOrCode> Js
{
get
{
InitializeProperty("js", _js);
return _js;
}
set
{
_js = value;
}
}

// Property Definition
private bool? _allFrames;
/// <summary>
/// If allFrames is <c>true</c>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <c>false</c> and is only injected into the top frame.
/// </summary>
[JsonPropertyName("allFrames")]
public bool? AllFrames { get; set; }
public bool? AllFrames
{
get
{
InitializeProperty("allFrames", _allFrames);
return _allFrames;
}
set
{
_allFrames = value;
}
}

// Property Definition
private bool? _matchAboutBlank;
/// <summary>
/// If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is <c>false</c>.
/// </summary>
[JsonPropertyName("matchAboutBlank")]
public bool? MatchAboutBlank { get; set; }
public bool? MatchAboutBlank
{
get
{
InitializeProperty("matchAboutBlank", _matchAboutBlank);
return _matchAboutBlank;
}
set
{
_matchAboutBlank = value;
}
}

// Property Definition
private ExtensionTypes.RunAt _runAt;
/// <summary>
/// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle".
/// </summary>
[JsonPropertyName("runAt")]
public ExtensionTypes.RunAt RunAt { get; set; }
public ExtensionTypes.RunAt RunAt
{
get
{
InitializeProperty("runAt", _runAt);
return _runAt;
}
set
{
_runAt = value;
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file is auto generated at 2021-03-26T07:08:47
10 changes: 4 additions & 6 deletions src/WebExtension.Net/Generated/Events/Event.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

using System;
using System.Collections.Generic;
using System.Text.Json;
Expand All @@ -21,7 +19,7 @@ public class Event : BaseObject
/// </summary>
public virtual ValueTask AddListener()
{
return webExtensionJSRuntime.InvokeVoidAsync("");
return InvokeVoidAsync("addListener");
}

// Function Definition
Expand All @@ -30,7 +28,7 @@ public virtual ValueTask AddListener()
/// </summary>
public virtual ValueTask RemoveListener()
{
return webExtensionJSRuntime.InvokeVoidAsync("");
return InvokeVoidAsync("removeListener");
}

// Function Definition
Expand All @@ -40,7 +38,7 @@ public virtual ValueTask RemoveListener()
/// <returns></returns>
public virtual ValueTask<bool> HasListener()
{
return webExtensionJSRuntime.InvokeAsync<bool>("");
return InvokeAsync<bool>("hasListener");
}

// Function Definition
Expand All @@ -50,7 +48,7 @@ public virtual ValueTask<bool> HasListener()
/// <returns></returns>
public virtual ValueTask<bool> HasListeners()
{
return webExtensionJSRuntime.InvokeAsync<bool>("");
return InvokeAsync<bool>("hasListeners");
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/WebExtension.Net/Generated/Events/Events.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// This file is auto generated at 2021-03-24T04:51:22

[
{
"namespace": "events",
Expand Down
Loading

0 comments on commit 3110a0f

Please sign in to comment.