Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Olm
Commits
954d6f98
Commit
954d6f98
authored
4 years ago
by
Hubert Chathi
Browse files
Options
Downloads
Patches
Plain Diff
initial TypeScript definition file
parent
930c4677
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
javascript/index.d.ts
+89
-0
89 additions, 0 deletions
javascript/index.d.ts
javascript/package.json
+1
-0
1 addition, 0 deletions
javascript/package.json
with
90 additions
and
0 deletions
javascript/index.d.ts
0 → 100644
+
89
−
0
View file @
954d6f98
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export
as
namespace
Olm
;
declare
class
Account
{
constructor
();
free
();
create
();
identity_keys
():
string
;
sign
(
message
:
string
):
string
;
one_time_keys
():
string
;
mark_keys_as_published
();
max_number_of_one_time_keys
():
number
;
generate_one_time_keys
(
number_of_keys
:
number
);
remove_one_time_keys
(
session
:
Session
);
pickle
(
key
:
string
):
string
;
unpickle
(
key
:
string
,
pickle
:
string
);
}
declare
class
Session
{
constructor
();
free
():
void
;
pickle
(
key
:
string
):
string
;
unpickle
(
key
:
string
,
pickle
:
string
);
create_outbound
(
account
:
Account
,
their_identity_key
:
string
,
their_one_time_key
:
string
,
):
void
;
create_inbound
(
account
:
Account
,
one_time_key_message
:
string
):
void
;
create_inbound_from
(
account
:
Account
,
identity_key
:
string
,
one_time_key_message
:
string
,
):
void
;
session_id
():
string
;
has_received_message
():
boolean
;
matches_inbound
(
one_time_key_message
:
string
):
boolean
;
matches_inbound_from
(
identity_key
:
string
,
one_time_key_message
:
string
):
boolean
;
encrypt
(
plaintext
:
string
):
object
;
decrypt
(
message_type
:
number
,
message
:
string
):
string
;
describe
():
string
;
}
declare
class
Utility
{
constructor
();
free
():
void
;
sha256
(
input
:
string
):
string
;
ed25519verify
(
key
:
string
,
message
:
string
,
signature
:
string
):
void
;
}
declare
class
PkEncryption
{
constructor
();
free
():
void
;
set_recipient_key
(
key
:
string
):
void
;
encrypt
(
plaintext
:
string
):
object
;
}
declare
class
PkDecryption
{
constructor
();
free
():
void
;
init_with_private_key
(
key
:
Uint8Array
):
string
;
generate_key
():
string
;
get_private_key
():
Uint8Array
;
pickle
(
key
:
string
):
string
;
unpickle
(
key
:
string
,
pickle
:
string
):
string
;
}
declare
class
PkSigning
{
constructor
();
free
():
void
;
init_with_seed
(
seed
:
Uint8Array
):
string
;
generate_seed
():
Uint8Array
;
sign
(
message
:
string
):
string
;
}
export
function
init
():
Promise
<
void
>
;
export
function
get_library_version
():
[
number
,
number
,
number
];
This diff is collapsed.
Click to expand it.
javascript/package.json
+
1
−
0
View file @
954d6f98
...
...
@@ -7,6 +7,7 @@
"olm.js"
,
"olm.wasm"
,
"olm_legacy.js"
,
"index.d.ts"
,
"README.md"
],
"scripts"
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment