@atlassian/clientside-extensions-registry
Advanced tools
Comparing version 1.0.0 to 1.0.1-57764fc
@@ -1,2 +0,2 @@ | ||
import { PluginAttributesProvider, PluginDescriptor } from './types'; | ||
import { PluginDescriptor, PluginAttributesProvider } from './types'; | ||
/** | ||
@@ -22,3 +22,3 @@ * Registry of Client-side Extensions and Client Locations | ||
getLocation(locationName: string): import("@atlassian/clientside-extensions-base").Observable<{ | ||
descriptors: PluginDescriptor[]; | ||
descriptors: PluginDescriptor<import("./types").PluginAttributes>[]; | ||
loadingState: boolean; | ||
@@ -25,0 +25,0 @@ }>; |
@@ -1,9 +0,1 @@ | ||
export interface BasePluginDescriptor { | ||
key: string; | ||
location: string; | ||
weight: number; | ||
params?: { | ||
[key: string]: unknown; | ||
}; | ||
} | ||
export declare type Context<T extends object> = { | ||
@@ -18,2 +10,11 @@ [K in keyof T]: T[K]; | ||
} | ||
interface BasePluginDescriptor<T> { | ||
key: string; | ||
location: string; | ||
weight: number; | ||
attributes: T; | ||
params?: { | ||
[key: string]: unknown; | ||
}; | ||
} | ||
declare type AttributeUpdatePayload = PluginAttributes | ((previousAttributes: PluginAttributes) => PluginAttributes); | ||
@@ -26,5 +27,4 @@ export declare type PluginCleanupCallback = () => void; | ||
export declare type PluginAttributesProvider = (api: PluginAPI, context: Context<{}>) => PluginAttributes; | ||
export interface PluginDescriptor extends BasePluginDescriptor { | ||
export interface PluginDescriptor<T = PluginAttributes> extends BasePluginDescriptor<T> { | ||
attributesProvider?: PluginAttributesProvider; | ||
attributes?: PluginAttributes; | ||
} | ||
@@ -31,0 +31,0 @@ /** |
@@ -46,4 +46,4 @@ import { onDebug } from '@atlassian/clientside-extensions-debug'; | ||
const testDescriptors: PluginDescriptor[] = [ | ||
{ key: 'test-plugin-1', location: 'test-location', weight: 10 }, | ||
{ key: 'test-plugin-2', location: 'test-location', weight: 10 }, | ||
{ key: 'test-plugin-1', location: 'test-location', weight: 10, attributes: {} }, | ||
{ key: 'test-plugin-2', location: 'test-location', weight: 10, attributes: {} }, | ||
]; | ||
@@ -195,4 +195,4 @@ let registry: ClientPluginsRegistry; | ||
const testDescriptors: PluginDescriptor[] = [ | ||
{ key: 'test-plugin-1', location: 'test-location', weight: 10 }, | ||
{ key: 'test-plugin-2', location: 'test-location', weight: 10 }, | ||
{ key: 'test-plugin-1', location: 'test-location', weight: 10, attributes: {} }, | ||
{ key: 'test-plugin-2', location: 'test-location', weight: 10, attributes: {} }, | ||
]; | ||
@@ -199,0 +199,0 @@ let registry: ClientPluginsRegistry; |
import { onDebug } from '@atlassian/clientside-extensions-debug'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { PluginAttributesProvider, PluginDescriptor } from './types'; | ||
import { PluginDescriptor, PluginAttributesProvider } from './types'; | ||
@@ -5,0 +5,0 @@ import LocationsSubject from './LocationSubject'; |
@@ -1,10 +0,1 @@ | ||
export interface BasePluginDescriptor { | ||
key: string; | ||
location: string; | ||
weight: number; | ||
params?: { | ||
[key: string]: unknown; | ||
}; | ||
} | ||
export type Context<T extends object> = { | ||
@@ -22,2 +13,12 @@ [K in keyof T]: T[K]; | ||
interface BasePluginDescriptor<T> { | ||
key: string; | ||
location: string; | ||
weight: number; | ||
attributes: T; | ||
params?: { | ||
[key: string]: unknown; | ||
}; | ||
} | ||
type AttributeUpdatePayload = PluginAttributes | ((previousAttributes: PluginAttributes) => PluginAttributes); | ||
@@ -32,5 +33,4 @@ export type PluginCleanupCallback = () => void; | ||
export interface PluginDescriptor extends BasePluginDescriptor { | ||
export interface PluginDescriptor<T = PluginAttributes> extends BasePluginDescriptor<T> { | ||
attributesProvider?: PluginAttributesProvider; | ||
attributes?: PluginAttributes; | ||
} | ||
@@ -37,0 +37,0 @@ |
{ | ||
"name": "@atlassian/clientside-extensions-registry", | ||
"version": "1.0.0", | ||
"version": "1.0.1-57764fc", | ||
"description": "Implements the browser runtime for the client-side extensions.", | ||
@@ -59,4 +59,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@atlassian/clientside-extensions-base": "^1.0.0", | ||
"@atlassian/clientside-extensions-debug": "^1.0.0" | ||
"@atlassian/clientside-extensions-base": "^1.0.1-57764fc", | ||
"@atlassian/clientside-extensions-debug": "^1.0.1-57764fc" | ||
}, | ||
@@ -69,3 +69,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "f692b5c1afaf9fa9fc6925c80f1ce25c0a713514" | ||
"gitHead": "57764fccf33660901b9d53fff35787e09d41629a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
44666
1
1