-
Notifications
You must be signed in to change notification settings - Fork 2
/
ProvidedTypes-headd.fsi
374 lines (264 loc) · 18.5 KB
/
ProvidedTypes-headd.fsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
// Copyright (c) Microsoft Corporation 2005-2012.
// This sample code is provided "as is" without warranty of any kind.
// We disclaim all warranties, either express or implied, including the
// warranties of merchantability and fitness for a particular purpose.
// This file contains a set of helper types and methods for providing types in an implementation
// of ITypeProvider.
//
// This code is a sample for use in conjunction with the F# 3.0 Developer Preview release of September 2011.
namespace Samples.FSharp.ProvidedTypes
open System
open System.Reflection
open System.Linq.Expressions
open Microsoft.FSharp.Core.CompilerServices
/// Represents an erased provided parameter
type internal ProvidedParameter =
inherit System.Reflection.ParameterInfo
new : parameterName: string * parameterType: Type * ?isOut:bool * ?optionalValue:obj -> ProvidedParameter
member IsParamArray : bool with get,set
/// Represents an erased provided constructor.
type internal ProvidedConstructor =
inherit System.Reflection.ConstructorInfo
/// Create a new provided constructor. It is not initially associated with any specific provided type definition.
new : parameters: ProvidedParameter list -> ProvidedConstructor
/// Add a 'System.Obsolete' attribute to this provided constructor
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided constructor, where the documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Set the quotation used to compute the implementation of invocations of this constructor.
member InvokeCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Set the target and arguments of the base constructor call. Only used for generated types.
member BaseConstructorCall : (Quotations.Expr list -> ConstructorInfo * Quotations.Expr list) with set
/// Set a flag indicating that the constructor acts like an F# implicit constructor, so the
/// parameters of the constructor become fields and can be accessed using Expr.GlobalVar with the
/// same name.
member IsImplicitCtor : bool with set
/// Add definition location information to the provided constructor.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
type internal ProvidedMethod =
inherit System.Reflection.MethodInfo
/// Create a new provided method. It is not initially associated with any specific provided type definition.
new : methodName:string * parameters: ProvidedParameter list * returnType: Type -> ProvidedMethod
/// Add XML documentation information to this provided method
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
member AddMethodAttrs : attributes:MethodAttributes -> unit
/// Set the method attributes of the method. By default these are simple 'MethodAttributes.Public'
member SetMethodAttrs : attributes:MethodAttributes -> unit
/// Get or set a flag indicating if the property is static.
member IsStaticMethod : bool with get, set
/// Set the quotation used to compute the implementation of invocations of this method.
member InvokeCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Add definition location information to the provided type definition.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Represents an erased provided property.
type internal ProvidedProperty =
inherit System.Reflection.PropertyInfo
/// Create a new provided type. It is not initially associated with any specific provided type definition.
new : propertyName: string * propertyType: Type * ?parameters:ProvidedParameter list -> ProvidedProperty
/// Add a 'System.Obsolete' attribute to this provided property
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Get or set a flag indicating if the property is static.
member IsStatic : bool with set
/// Set the quotation used to compute the implementation of gets of this property.
member GetterCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Set the function used to compute the implementation of sets of this property.
member SetterCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Add definition location information to the provided type definition.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Represents an erased provided property.
type internal ProvidedEvent =
inherit System.Reflection.EventInfo
/// Create a new provided type. It is not initially associated with any specific provided type definition.
new : propertyName: string * eventHandlerType: Type -> ProvidedEvent
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Get or set a flag indicating if the property is static.
member IsStatic : bool with set
/// Set the quotation used to compute the implementation of gets of this property.
member AdderCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Set the function used to compute the implementation of sets of this property.
member RemoverCode : (Quotations.Expr list -> Quotations.Expr) with set
/// Add definition location information to the provided type definition.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Represents an erased provided field.
type internal ProvidedLiteralField =
inherit System.Reflection.FieldInfo
/// Create a new provided field. It is not initially associated with any specific provided type definition.
new : fieldName: string * fieldType: Type * literalValue: obj -> ProvidedLiteralField
/// Add a 'System.Obsolete' attribute to this provided field
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided field
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided field, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided field, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Add definition location information to the provided field.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Represents an erased provided field.
type internal ProvidedField =
inherit System.Reflection.FieldInfo
/// Create a new provided field. It is not initially associated with any specific provided type definition.
new : fieldName: string * fieldType: Type -> ProvidedField
/// Add a 'System.Obsolete' attribute to this provided field
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided field
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided field, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided field, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Add definition location information to the provided field definition.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Provides symbolic provided types
[<Class>]
type internal ProvidedTypeBuilder =
/// Like typ.MakeGenericType, but will also work with unit-annotated types
static member MakeGenericType: genericTypeDefinition: System.Type * genericArguments: System.Type list -> System.Type
/// Like methodInfo.MakeGenericMethod, but will also work with unit-annotated types and provided types
static member MakeGenericMethod: genericMethodDefinition: System.Reflection.MethodInfo * genericArguments: System.Type list -> MethodInfo
/// Helps create erased provided unit-of-measure annotations.
[<Class>]
type internal ProvidedMeasureBuilder =
/// The ProvidedMeasureBuilder for building measures.
static member Default : ProvidedMeasureBuilder
/// e.g. 1
member One : System.Type
/// e.g. m * kg
member Product : measure1: System.Type * measure1: System.Type -> System.Type
/// e.g. 1 / kg
member Inverse : denominator: System.Type -> System.Type
/// e.g. kg / m
member Ratio : numerator: System.Type * denominator: System.Type -> System.Type
/// e.g. m * m
member Square : ``measure``: System.Type -> System.Type
/// the SI unit from the F# core library, where the string is in capitals and US spelling, e.g. Meter
member SI : string -> System.Type
/// e.g. float<kg>, Vector<int, kg>
member AnnotateType : basic: System.Type * argument: System.Type list -> System.Type
/// Represents a provided static parameter.
type internal ProvidedStaticParameter =
inherit System.Reflection.ParameterInfo
new : parameterName: string * parameterType:Type * ?parameterDefaultValue:obj -> ProvidedStaticParameter
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Represents a provided type definition.
type internal ProvidedTypeDefinition =
inherit System.Type
/// Create a new provided type definition in a namespace.
new : assembly: Assembly * namespaceName: string * className: string * baseType: Type option -> ProvidedTypeDefinition
/// Create a new provided type definition, to be located as a nested type in some type definition.
new : className : string * baseType: Type option -> ProvidedTypeDefinition
/// Add the given type as an implemented interface.
member AddInterfaceImplementation : interfaceType: Type -> unit
/// Add the given function as a set of on-demand computed interfaces.
member AddInterfaceImplementationsDelayed : interfacesFunction:(unit -> Type list)-> unit
/// Specifies that the given method body implements the given method declaration.
member DefineMethodOverride : methodInfoBody: ProvidedMethod * methodInfoDeclaration: MethodInfo -> unit
/// Add a 'System.Obsolete' attribute to this provided type definition
member AddObsoleteAttribute : message: string -> unit
/// Add XML documentation information to this provided constructor
member AddXmlDoc : xmlDoc: string -> unit
/// Set the base type
member SetBaseType : Type -> unit
/// Set the base type to a lazily evaluated value
member SetBaseTypeDelayed : Lazy<Type option> -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary.
/// The documentation is only computed once.
member AddXmlDocDelayed : xmlDocFunction: (unit -> string) -> unit
/// Add XML documentation information to this provided constructor, where the computation of the documentation is delayed until necessary
/// The documentation is re-computed every time it is required.
member AddXmlDocComputed : xmlDocFunction: (unit -> string) -> unit
/// Set the attributes on the provided type. This fully replaces the default TypeAttributes.
member SetAttributes : System.Reflection.TypeAttributes -> unit
/// Reset the enclosing type (for generated nested types)
member ResetEnclosingType: enclosingType:System.Type -> unit
/// Add a method, property, nested type or other member to a ProvidedTypeDefinition
member AddMember : memberInfo:MemberInfo -> unit
/// Add a set of members to a ProvidedTypeDefinition
member AddMembers : memberInfos:list<#MemberInfo> -> unit
/// Add a member to a ProvidedTypeDefinition, delaying computation of the members until required by the compilation context.
member AddMemberDelayed : memberFunction:(unit -> #MemberInfo) -> unit
/// Add a set of members to a ProvidedTypeDefinition, delaying computation of the members until required by the compilation context.
member AddMembersDelayed : (unit -> list<#MemberInfo>) -> unit
/// Add the types of the generated assembly as generative types, where types in namespaces get hierarchically positioned as nested types.
member AddAssemblyTypesAsNestedTypesDelayed : assemblyFunction:(unit -> System.Reflection.Assembly) -> unit
// Parametric types
member DefineStaticParameters : parameters: ProvidedStaticParameter list * instantiationFunction: (string -> obj[] -> ProvidedTypeDefinition) -> unit
/// Add definition location information to the provided type definition.
member AddDefinitionLocation : line:int * column:int * filePath:string -> unit
/// Suppress System.Object entries in intellisense menus in instances of this provided type
member HideObjectMethods : bool with set
/// Get or set a flag indicating if the ProvidedTypeDefinition is erased
member IsErased : bool with get,set
/// Get or set a flag indicating if the ProvidedTypeDefinition has type-relocation suppressed
[<Experimental("SuppressRelocation is a workaround and likely to be removed")>]
member SuppressRelocation : bool with get,set
/// A provided generated assembly
type ProvidedAssembly =
new : assemblyFileName:string -> ProvidedAssembly
/// <summary>
/// Emit the given provided type definitions as part of the assembly
/// and adjust the 'Assembly' property of all provided type definitions to return that
/// assembly.
///
/// The assembly is only emitted when the Assembly property on the root type is accessed for the first time.
/// The host F# compiler does this when processing a generative type declaration for the type.
/// </summary>
/// <param name="enclosingTypeNames">An optional path of type names to wrap the generated types. The generated types are then generated as nested types.</param>
member AddTypes : types : ProvidedTypeDefinition list -> unit
member AddNestedTypes : types : ProvidedTypeDefinition list * enclosingGeneratedTypeNames: string list -> unit
#if FX_NO_LOCAL_FILESYSTEM
#else
/// Register that a given file is a provided generated assembly
static member RegisterGenerated : fileName:string -> Assembly
#endif
/// A base type providing default implementations of type provider functionality when all provided
/// types are of type ProvidedTypeDefinition.
type TypeProviderForNamespaces =
/// Initializes a type provider to provide the types in the given namespace.
internal new : namespaceName:string * types: ProvidedTypeDefinition list -> TypeProviderForNamespaces
/// Initializes a type provider
internal new : unit -> TypeProviderForNamespaces
/// Add a namespace of provided types.
member internal AddNamespace : namespaceName:string * types: ProvidedTypeDefinition list -> unit
/// Invalidate the information provided by the provider
member Invalidate : unit -> unit
#if FX_NO_LOCAL_FILESYSTEM
#else
/// AssemblyResolve handler. Default implementation searches <assemblyname>.dll file in registered folders
abstract ResolveAssembly : System.ResolveEventArgs -> Assembly
default ResolveAssembly : System.ResolveEventArgs -> Assembly
/// Registers custom probing path that can be used for probing assemblies
member RegisterProbingFolder : folder : string -> unit
/// Registers location of RuntimeAssembly (from TypeProviderConfig) as probing folder
member RegisterRuntimeAssemblyLocationAsProbingFolder : cfg : Core.CompilerServices.TypeProviderConfig -> unit
#endif
interface ITypeProvider