|
| 1 | +<!-- USAGE |
| 2 | + * Fill in each of the sections (like Background) below |
| 3 | + * Wrap code with `single line of code` or ```code block``` |
| 4 | + * Before submitting, delete all <!-- TEMPLATE marked comments in this file, |
| 5 | + and the following quote banner: |
| 6 | +--> |
| 7 | +> See comments in Markdown for how to use this spec template |
| 8 | +
|
| 9 | +<!-- TEMPLATE |
| 10 | + The purpose of this spec is to describe a new WebView2 feature and its APIs. |
| 11 | +
|
| 12 | + There are two audiences for the spec. The first are people |
| 13 | + that want to evaluate and give feedback on the API, as part of |
| 14 | + the submission process. When it's complete |
| 15 | + it will be incorporated into the public documentation at |
| 16 | + docs.microsoft.com (https://docs.microsoft.com/en-us/microsoft-edge/webview2/). |
| 17 | + Hopefully we'll be able to copy it mostly verbatim. |
| 18 | + So the second audience is everyone that reads there to learn how |
| 19 | + and why to use this API. |
| 20 | +--> |
| 21 | + |
| 22 | + |
| 23 | +# Background |
| 24 | +<!-- TEMPLATE |
| 25 | + Use this section to provide background context for the new API(s) |
| 26 | + in this spec. |
| 27 | +
|
| 28 | + This section and the appendix are the only sections that likely |
| 29 | + do not get copied into any official documentation, they're just an aid |
| 30 | + to reading this spec. |
| 31 | + |
| 32 | + If you're modifying an existing API, included a link here to the |
| 33 | + existing page(s) or spec documentation. |
| 34 | +
|
| 35 | + For example, this section is a place to explain why you're adding this |
| 36 | + API rather than modifying an existing API. |
| 37 | +
|
| 38 | + If you're writing a "converged" API add links into docs.microsoft.com |
| 39 | + for the existing Win32 or WinRT APIs that are being converged. |
| 40 | + |
| 41 | + For example, this is a place to provide a brief explanation of some dependent |
| 42 | + area, just explanation enough to understand this new API, rather than telling |
| 43 | + the reader "go read 100 pages of background information posted at ...". |
| 44 | +--> |
| 45 | + |
| 46 | +In this document we describe the updated API. We'd appreciate your feedback. |
| 47 | + |
| 48 | + |
| 49 | +# Description |
| 50 | +<!-- TEMPLATE |
| 51 | + Use this section to provide a brief description of the feature. |
| 52 | + For an example, see the introduction to the PasswordBox control |
| 53 | + (http://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box). |
| 54 | +--> |
| 55 | + |
| 56 | + |
| 57 | +# Examples |
| 58 | +<!-- TEMPLATE |
| 59 | + Use this section to explain the features of the API, showing |
| 60 | + example code with each description. The general format is: |
| 61 | +
|
| 62 | + ## FirstFeatureName |
| 63 | +
|
| 64 | + Feature explanation text goes here, including why an app would use it, how it |
| 65 | + replaces or supplements existing functionality. |
| 66 | +
|
| 67 | + ```c# |
| 68 | + void SampleMethod() { |
| 69 | + var show = new AnExampleOf(); |
| 70 | + show.SomeMembers = AndWhyItMight(be, interesting) |
| 71 | + } |
| 72 | + ``` |
| 73 | +
|
| 74 | + ## SecondFeatureName |
| 75 | +
|
| 76 | + Feature explanation text goes here, including why an app would use it, how it |
| 77 | + replaces or supplements existing functionality. |
| 78 | +
|
| 79 | + ```c# |
| 80 | + void SampleMethod() { |
| 81 | + var show = new AnExampleOf(); |
| 82 | + show.SomeMembers = AndWhyItMight(be, interesting) |
| 83 | + } |
| 84 | + ``` |
| 85 | +
|
| 86 | + Code samples should be in C# and/or C++/WinRT. |
| 87 | +
|
| 88 | + As an example of this section, see the Examples section for the PasswordBox |
| 89 | + control (https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box#examples). |
| 90 | +--> |
| 91 | + |
| 92 | + |
| 93 | +# Remarks |
| 94 | +<!-- TEMPLATE |
| 95 | + Explanation and guidance that doesn't fit into the Examples section. |
| 96 | +
|
| 97 | + APIs should only throw exceptions in exceptional conditions; basically, |
| 98 | + only when there's a bug in the caller, such as argument exception. But if for some |
| 99 | + reason it's necessary for a caller to catch an exception from an API, call that |
| 100 | + out with an explanation either here or in the Examples |
| 101 | +--> |
| 102 | + |
| 103 | + |
| 104 | +# API Notes |
| 105 | +<!-- TEMPLATE |
| 106 | + Option 1: Give a one or two line description of each API (type and member), |
| 107 | + or at least the ones that aren't obvious from their name. These |
| 108 | + descriptions are what show up in IntelliSense. For properties, specify |
| 109 | + the default value of the property if it isn't the type's default (for |
| 110 | + example an int-typed property that doesn't default to zero.) |
| 111 | + |
| 112 | + Option 2: Put these descriptions in the below API Details section, |
| 113 | + with a "///" comment above the member or type. |
| 114 | +--> |
| 115 | + |
| 116 | + |
| 117 | +# API Details |
| 118 | +<!-- TEMPLATE |
| 119 | + The exact API, in MIDL3 format (https://docs.microsoft.com/en-us/uwp/midl-3/) |
| 120 | + when possible, or in C# if starting with an API sketch. GitHub's markdown |
| 121 | + syntax formatter does not (yet) know about MIDL3, so use ```c# instead even |
| 122 | + when writing MIDL3. |
| 123 | +
|
| 124 | + Example: |
| 125 | +
|
| 126 | + ```c# (but really MIDL3) |
| 127 | + namespace Microsoft.AppModel |
| 128 | + { |
| 129 | + /// Represents a package on the host system. See Windows.ApplicationModel.Package for more details |
| 130 | + runtimeclass Package |
| 131 | + { |
| 132 | + /// Returns the current package, or null if the current process is not packaged |
| 133 | + static Package Current { get; }; |
| 134 | +
|
| 135 | + /// Returns the package from the system store with this full name or null if not found |
| 136 | + static Package GetFromFullName(String fullName); |
| 137 | +
|
| 138 | + /// Returns packages in the given family, by name |
| 139 | + static Package[] FindByFamilyName(String familyName); |
| 140 | + } |
| 141 | + } |
| 142 | + ``` |
| 143 | +--> |
| 144 | + |
| 145 | + |
| 146 | +# Appendix |
| 147 | +<!-- TEMPLATE |
| 148 | + Anything else that you want to write down for posterity, but |
| 149 | + that isn't necessary to understand the purpose and usage of the API. |
| 150 | + For example, implementation details or links to other resources. |
| 151 | +--> |
0 commit comments