Interface: ConnectedPlugin\<Name, UriType, ResourceType, ContextType, CreateResourceOptions>
A ConnectedPlugin can be passed to a ConnectedDataset to allow it to connect to a remote platform.
Type parameters
Name | Type |
---|---|
Name |
extends string = any |
UriType |
extends string = any |
ResourceType |
extends Resource \<UriType > = any |
ContextType |
any |
CreateResourceOptions |
any |
Properties
initialContext
• initialContext: ContextType
A starting context
Defined in
packages/connected/src/ConnectedPlugin.ts:55
name
• name: Name
The name of the plugin ("solid" for example).
Defined in
packages/connected/src/ConnectedPlugin.ts:20
normalizeUri
• Optional
normalizeUri: (uri
: UriType
) => UriType
Optional function that takes in a URI and returns a normalized uri. For
example https://example.com/profile#me
becomes
https://example.com/profile
.
Type declaration
▸ (uri
): UriType
Parameters
Name | Type | Description |
---|---|---|
uri |
UriType |
The uri to normalize |
Returns
UriType
Defined in
packages/connected/src/ConnectedPlugin.ts:51
types
• types: Object
This object exists to transfer typescript types. It does not need to be filled out in an actual instance.
Type declaration
Name | Type |
---|---|
context |
ContextType |
createResourceOptions |
CreateResourceOptions |
resource |
ResourceType |
uri |
UriType |
Defined in
packages/connected/src/ConnectedPlugin.ts:60
Methods
createResource
▸ createResource(context
, createResourceOptions?
): Promise
\<ErrorResult
| ResourceType
>
A function that will create a resource on the remote at a random URI.
Parameters
Name | Type | Description |
---|---|---|
context |
ConnectedContext \<ConnectedPlugin \<Name , UriType , ResourceType , ContextType , CreateResourceOptions >[]> |
the context for the plugin |
createResourceOptions? |
CreateResourceOptions |
special options for creating a resource that varies based on the plugin |
Returns
Promise
\<ErrorResult
| ResourceType
>
Defined in
packages/connected/src/ConnectedPlugin.ts:34
getResource
▸ getResource(uri
, context
): ResourceType
A function that returns a newly minted resource on this platform. This function does not fetch the resource or interface with a cache.
Parameters
Name | Type | Description |
---|---|---|
uri |
UriType |
The uri of the resource |
context |
ConnectedContext \<ConnectedPlugin \<Name , UriType , ResourceType , ContextType , CreateResourceOptions >[]> |
The context for the plugin |
Returns
ResourceType
Defined in
packages/connected/src/ConnectedPlugin.ts:27
isUriValid
▸ isUriValid(uri
): uri is UriType
Checks if a specific uri is valid for this plugin
Parameters
Name | Type | Description |
---|---|---|
uri |
string |
the URI to check |
Returns
uri is UriType
true if this is a valid URI