# Public Methods

#### Display Methods

Every display message method will return the id of the message instance.  You can pass the [data object](https://smwb-tech.gitbook.io/vue-flash-message/data-object) to configure a message instance as first argument and [callbacks object](https://smwb-tech.gitbook.io/vue-flash-message/callbacks-object) as second argument.

```javascript
// Basic usage
this.flashMessage.show({
    status: 'error',
    title: 'Error Message Title',
    message: 'Oh, you broke my heart! Shame on you!'
});
```

You also can use shorthands without status property

```javascript
this.flashMessage.error({
	title: 'Error Message Title',
	message: 'Oh, you broke my heart! Shame on you!'
});
this.flashMessage.warning({
	title: 'Warning Message Title',
	message: "Don't stop me nooooow....!"
});
this.flashMessage.info({
	title: 'Info Message Title',
	message: 'Just want you to know, that Vue is so cool'
});
this.flashMessage.success({
	title: 'Success Message Title',
	message: 'Hoorah, it is my fist npm package and it works!'
});
```

#### Delete Method

You can delete message programmatically using deleteMessage method

```javascript
let id = this.flashMessage.info({
	title: 'Hey, man. Time for beer!',
	message: 'It is Friday. Time to have a little party.'
});
this.flashMessage.deleteMessage(id);
```

#### Switch strategy method

You can update default strategy using setStrategy method.

```javascript
/* Will return {Boolean} as result */
this.flashMessage.setStrategy('multiple'); // strategy changed to multiple
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smwb-tech.gitbook.io/vue-flash-message/public-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
